gtype: Fast-path for g_type_is_a
authorEdward Hervey <bilboed@bilboed.com>
Mon, 23 Jun 2014 09:39:04 +0000 (11:39 +0200)
committerEdward Hervey <edward@collabora.com>
Fri, 8 Aug 2014 09:13:38 +0000 (11:13 +0200)
Do I really need to explain why ?

https://bugzilla.gnome.org/show_bug.cgi?id=732085

gobject/gtype.c

index f766ffd..dff5b4a 100644 (file)
@@ -3499,6 +3499,9 @@ g_type_is_a (GType type,
 {
   TypeNode *node, *iface_node;
   gboolean is_a;
+
+  if (type == iface_type)
+    return TRUE;
   
   node = lookup_type_node_I (type);
   iface_node = lookup_type_node_I (iface_type);