Commit: d565b861e6f31f09d8a371b7ebf22ad0c78fdcbc
Author: Thomas Dinges
Date:   Sun May 22 22:47:37 2016 +0200
Branches: compositor-2016
https://developer.blender.org/rBd565b861e6f31f09d8a371b7ebf22ad0c78fdcbc

Cleanup: Use short condition style.

===================================================================

M       intern/cycles/render/image.cpp

===================================================================

diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index 9f40e56..150c742 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -141,19 +141,11 @@ ImageManager::ImageDataType 
ImageManager::get_image_metadata(const string& filen
 
                if(is_float) {
                        is_linear = true;
-
-                       if(channels > 1)
-                               return IMAGE_DATA_TYPE_FLOAT4;
-                       else
-                               return IMAGE_DATA_TYPE_FLOAT;
+                       return (channels > 1) ? IMAGE_DATA_TYPE_FLOAT4 : 
IMAGE_DATA_TYPE_FLOAT;
                }
                else {
-                       if(channels > 1)
-                               return IMAGE_DATA_TYPE_BYTE4;
-                       else
-                               return IMAGE_DATA_TYPE_BYTE;
+                       return (channels > 1) ? IMAGE_DATA_TYPE_BYTE4 : 
IMAGE_DATA_TYPE_BYTE;
                }
-
        }
 
        ImageInput *in = ImageInput::create(filename);
@@ -202,16 +194,10 @@ ImageManager::ImageDataType 
ImageManager::get_image_metadata(const string& filen
        }
 
        if(is_float) {
-               if(channels > 1)
-                       return IMAGE_DATA_TYPE_FLOAT4;
-               else
-                       return IMAGE_DATA_TYPE_FLOAT;
+               return (channels > 1) ? IMAGE_DATA_TYPE_FLOAT4 : 
IMAGE_DATA_TYPE_FLOAT;
        }
        else {
-               if(channels > 1)
-                       return IMAGE_DATA_TYPE_BYTE4;
-               else
-                       return IMAGE_DATA_TYPE_BYTE;
+               return (channels > 1) ? IMAGE_DATA_TYPE_BYTE4 : 
IMAGE_DATA_TYPE_BYTE;
        }
 }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to