[mutter/gbsneto/graphene-frustrum: 7/14] clutter/actor: Use switch instead of if/else
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/graphene-frustrum: 7/14] clutter/actor: Use switch instead of if/else
- Date: Sat, 10 Oct 2020 14:38:05 +0000 (UTC)
commit a02e123045392820092591f13cc5e7ac9a24c97f
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 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]