From e50460e39608492eb4cb54a0810306783d054e8b Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 24 Oct 2021 21:12:02 +0200 Subject: [PATCH] clutter: Turn warning into assert This warning is actually dead code, since should_be_mapped and must_be_realized are always set to the same value, so it does not make sense to check for "a && !b". Turn this into an assert so we avoid the dead branch, but do not remove the variable duplication so the more aptly named variable is used where it belongs, for clarity. CID: #1506254 Part-of: --- clutter/clutter/clutter-actor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 9a0dd48a7..1e495c5b3 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -1455,10 +1455,7 @@ clutter_actor_update_map_state (ClutterActor *self, /* Map */ if (should_be_mapped) { - if (!must_be_realized) - g_warning ("Somehow we think actor '%s' should be mapped but " - "not realized, which isn't allowed", - _clutter_actor_get_debug_name (self)); + g_assert (should_be_mapped == must_be_realized); /* realization is allowed to fail (though I don't know what * an app is supposed to do about that - shouldn't it just