clutter/actor: Avoid computing GStrv length for simple checks
No need to do a full iteration of the tokens or doing null-checks here since g_strsplit() is not nullable, while there's no need to do a full length check either. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
This commit is contained in:
parent
61c722881d
commit
1985d9ccdd
1 changed files with 3 additions and 3 deletions
|
@ -12021,7 +12021,7 @@ get_layout_from_animation_property (ClutterActor *actor,
|
|||
return FALSE;
|
||||
|
||||
tokens = g_strsplit (name, ".", -1);
|
||||
if (tokens == NULL || g_strv_length (tokens) != 2)
|
||||
if (tokens[0] == NULL || tokens[1] == NULL || tokens[2] != NULL)
|
||||
{
|
||||
CLUTTER_NOTE (ANIMATION, "Invalid property name '%s'",
|
||||
name + 1);
|
||||
|
@ -12052,7 +12052,7 @@ get_content_from_animation_property (ClutterActor *actor,
|
|||
}
|
||||
|
||||
tokens = g_strsplit (name, ".", -1);
|
||||
if (tokens == NULL || g_strv_length (tokens) != 2)
|
||||
if (tokens[0] == NULL || tokens[1] == NULL || tokens[2] != NULL)
|
||||
{
|
||||
CLUTTER_NOTE (ANIMATION, "Invalid property name '%s'",
|
||||
name + 1);
|
||||
|
@ -12092,7 +12092,7 @@ get_meta_from_animation_property (ClutterActor *actor,
|
|||
*/
|
||||
|
||||
tokens = g_strsplit (name + 1, ".", -1);
|
||||
if (tokens == NULL || g_strv_length (tokens) != 3)
|
||||
if (g_strv_length (tokens) != 3)
|
||||
{
|
||||
CLUTTER_NOTE (ANIMATION, "Invalid property name '%s'",
|
||||
name + 1);
|
||||
|
|
Loading…
Reference in a new issue