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




commit 3e0ae368c8e0dffbb6e05371e178b45144282e32
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.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489

 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 94a5e4ceea..c314c49a84 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -3364,12 +3364,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]