mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
param: Avoid strcmps
Most of the time, we are dealing with static strings, and we can compare them directly and avoid the strcmp. Note that triggering this optimization requires properties to be marked as G_PARAM_STATIC_NAME.
This commit is contained in:
parent
6b5b1cd314
commit
91dafa85fc
@ -923,7 +923,8 @@ param_spec_pool_equals (gconstpointer key_spec_1,
|
|||||||
const GParamSpec *key2 = key_spec_2;
|
const GParamSpec *key2 = key_spec_2;
|
||||||
|
|
||||||
return (key1->owner_type == key2->owner_type &&
|
return (key1->owner_type == key2->owner_type &&
|
||||||
strcmp (key1->name, key2->name) == 0);
|
(key1->name == key2->name ||
|
||||||
|
strcmp (key1->name, key2->name) == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user