Cycles: Cleanup, use switch() instead of if-else chain
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 12 Jan 2017 11:45:37 +0000 (12:45 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 12 Jan 2017 11:45:37 +0000 (12:45 +0100)
About to add extra debug passes, which will be more clear to use switch().

intern/cycles/blender/blender_session.cpp

index 21166b2f1555e2b3d56d8b214f4e11a44319bf07..f37e7d1755998bec44b9e0a868811da856ffd829 100644 (file)
@@ -305,12 +305,14 @@ static PassType get_pass_type(BL::RenderPass& b_pass)
 #ifdef WITH_CYCLES_DEBUG
                case BL::RenderPass::type_DEBUG:
                {
-                       if(b_pass.debug_type() == BL::RenderPass::debug_type_BVH_TRAVERSAL_STEPS)
-                               return PASS_BVH_TRAVERSAL_STEPS;
-                       if(b_pass.debug_type() == BL::RenderPass::debug_type_BVH_TRAVERSED_INSTANCES)
-                               return PASS_BVH_TRAVERSED_INSTANCES;
-                       if(b_pass.debug_type() == BL::RenderPass::debug_type_RAY_BOUNCES)
-                               return PASS_RAY_BOUNCES;
+                       switch(b_pass.debug_type()) {
+                               case BL::RenderPass::debug_type_BVH_TRAVERSAL_STEPS:
+                                       return PASS_BVH_TRAVERSAL_STEPS;
+                               case BL::RenderPass::debug_type_BVH_TRAVERSED_INSTANCES:
+                                       return PASS_BVH_TRAVERSED_INSTANCES;
+                               case BL::RenderPass::debug_type_RAY_BOUNCES:
+                                       return PASS_RAY_BOUNCES;
+                       }
                        break;
                }
 #endif