1
0
Fork 0

clutter/actor: Use switch instead of if/else

To improve legibility of the code.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
This commit is contained in:
Georges Basile Stavracas Neto 2020-10-09 19:23:41 -03:00
parent a84dccfd64
commit 80bd44cba0

View file

@ -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);