mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 04:15:49 +01:00
Merge branch 'wip/chergert/g_variant_type_is_subtype_of-fastpath' into 'main'
glib/gvarianttype: g_variant_type_is_subtype_of() fastpath See merge request GNOME/glib!4297
This commit is contained in:
commit
5d40bc448e
@ -867,6 +867,24 @@ g_variant_type_is_subtype_of (const GVariantType *type,
|
|||||||
supertype_string = g_variant_type_peek_string (supertype);
|
supertype_string = g_variant_type_peek_string (supertype);
|
||||||
type_string = g_variant_type_peek_string (type);
|
type_string = g_variant_type_peek_string (type);
|
||||||
|
|
||||||
|
/* fast path for the basic determinate types */
|
||||||
|
if (type_string[0] == supertype_string[0])
|
||||||
|
{
|
||||||
|
switch (type_string[0])
|
||||||
|
{
|
||||||
|
case 'b': case 'y':
|
||||||
|
case 'n': case 'q':
|
||||||
|
case 'i': case 'h': case 'u':
|
||||||
|
case 't': case 'x':
|
||||||
|
case 's': case 'o': case 'g':
|
||||||
|
case 'd':
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
supertype_end = supertype_string +
|
supertype_end = supertype_string +
|
||||||
g_variant_type_get_string_length (supertype);
|
g_variant_type_get_string_length (supertype);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user