[libsoup/new-io] Use g_type_is_a() in ugly hack.



commit 625ea9eb9363e4ab04756fa3b65646b92a3fcaba
Author: Benjamin Otte <otte gnome org>
Date:   Sun Dec 20 14:55:00 2009 +0100

    Use g_type_is_a() in ugly hack.
    
    It's much faster and actually works reliably.

 libsoup/soup-proxy-resolver.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/libsoup/soup-proxy-resolver.c b/libsoup/soup-proxy-resolver.c
index 33a908c..cdc3cc7 100644
--- a/libsoup/soup-proxy-resolver.c
+++ b/libsoup/soup-proxy-resolver.c
@@ -44,16 +44,11 @@ static void
 proxy_resolver_interface_check (gpointer func_data, gpointer g_iface)
 {
 	GTypeInterface *interface = g_iface;
-	GTypeClass *klass;
 
 	if (interface->g_type != SOUP_TYPE_PROXY_RESOLVER)
 		return;
 
-	klass = g_type_class_peek (interface->g_instance_type);
-	/* If the class hasn't already declared that it implements
-	 * SoupProxyURIResolver, add our own compat implementation.
-	 */
-	if (!g_type_interface_peek (klass, SOUP_TYPE_PROXY_URI_RESOLVER)) {
+	if (!g_type_is_a (interface->g_instance_type, SOUP_TYPE_PROXY_URI_RESOLVER)) {
 		const GInterfaceInfo uri_resolver_interface_info = {
 			(GInterfaceInitFunc) soup_proxy_resolver_uri_resolver_interface_init, NULL, NULL
 		};



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]