[mutter/gbsneto/graphene-frustrum: 8/16] clutter/actor: Use switch instead of if/else




commit cdd075b24da56c1b518f98b2786b6b11ea44baf8
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Oct 9 19:23:41 2020 -0300

    clutter/actor: Use switch instead of if/else
    
    To improve legibility of the code.

 clutter/clutter/clutter-actor.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 1b3929dc86..0c920a1cd0 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -3362,12 +3362,19 @@ _clutter_actor_paint_cull_result (ClutterActor      *self,
 
   if (success)
     {
-      if (result == CLUTTER_CULL_RESULT_IN)
-        clutter_color_init (&color, 0, 255, 0, 255);
-      else if (result == CLUTTER_CULL_RESULT_OUT)
-        clutter_color_init (&color, 0, 0, 255, 255);
-      else
-        clutter_color_init (&color, 0, 255, 255, 255);
+      switch (result)
+        {
+        case CLUTTER_CULL_RESULT_IN:
+          clutter_color_init (&color, 0, 255, 0, 255);
+          break;
+        case CLUTTER_CULL_RESULT_OUT:
+          clutter_color_init (&color, 0, 0, 255, 255);
+          break;
+        case CLUTTER_CULL_RESULT_PARTIAL:
+        default:
+          clutter_color_init (&color, 0, 255, 255, 255);
+          break;
+        }
     }
   else
     clutter_color_init (&color, 255, 255, 255, 255);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]