edbus: simplify returning new ref of obj/proxy
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 11 Dec 2012 19:51:34 +0000 (19:51 +0000)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Tue, 11 Dec 2012 19:51:34 +0000 (19:51 +0000)
Patch by: Lucas De Marchi <lucas.de.marchi@gmail.com>

SVN revision: 80705

legacy/edbus/src/lib/edbus_object.c
legacy/edbus/src/lib/edbus_proxy.c

index 6ff2450..647b6fa 100644 (file)
@@ -195,10 +195,7 @@ edbus_object_get(EDBus_Connection *conn, const char *bus, const char *path)
 
    obj = edbus_connection_name_object_get(conn, bus, path);
    if (obj)
-     {
-        edbus_object_ref(obj);
-        return obj;
-     }
+     return edbus_object_ref(obj);
 
    obj = calloc(1, sizeof(EDBus_Object));
    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
index c8ccadd..a2092da 100644 (file)
@@ -205,10 +205,7 @@ edbus_proxy_get(EDBus_Object *obj, const char *interface)
 
    proxy = edbus_object_proxy_get(obj, interface);
    if (proxy)
-     {
-        edbus_proxy_ref(proxy);
-        return proxy;
-     }
+     return edbus_proxy_ref(proxy);
 
    proxy = calloc(1, sizeof(EDBus_Proxy));
    EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);