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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2061>
This commit is contained in:
Carlos Garnacho 2021-10-24 21:12:02 +02:00
parent 774f120ac4
commit e50460e396

View File

@ -1455,10 +1455,7 @@ clutter_actor_update_map_state (ClutterActor *self,
/* Map */ /* Map */
if (should_be_mapped) if (should_be_mapped)
{ {
if (!must_be_realized) g_assert (should_be_mapped == 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));
/* realization is allowed to fail (though I don't know what /* realization is allowed to fail (though I don't know what
* an app is supposed to do about that - shouldn't it just * an app is supposed to do about that - shouldn't it just