From: Lucas De Marchi Date: Thu, 20 Dec 2012 14:52:15 +0000 (+0000) Subject: edbus: no need for this auxiliary variables, and check refcount first X-Git-Tag: upstream/1.7.8~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ead8c862744a697fbf8fb9b4a83bd899e2ac2e6e;p=platform%2Fupstream%2Feldbus.git edbus: no need for this auxiliary variables, and check refcount first SVN revision: 81461 --- diff --git a/src/lib/edbus_core.c b/src/lib/edbus_core.c index 0f90fe5..d999103 100644 --- a/src/lib/edbus_core.c +++ b/src/lib/edbus_core.c @@ -372,14 +372,11 @@ edbus_data_del_all(Eina_Inlist **p_list) static void edbus_connection_name_gc(EDBus_Connection *conn, EDBus_Connection_Name *cn) { - Eina_Bool have_obj; - Eina_Bool have_event_handlers; - - if (!cn->objects) have_obj = EINA_FALSE; - else have_obj = !!eina_hash_population(cn->objects); - have_event_handlers = cn->event_handlers.list != NULL; - - if (have_obj || have_event_handlers || cn->refcount > 0) + if (cn->refcount > 0) + return; + if (cn->objects && eina_hash_population(cn->objects) > 0) + return; + if (cn->event_handlers.list != NULL) return; eina_hash_del(conn->names, cn->name, cn); @@ -461,8 +458,6 @@ edbus_connection_name_unref(EDBus_Connection *conn, EDBus_Connection_Name *cn) EINA_SAFETY_ON_NULL_RETURN(cn); cn->refcount--; - - if (cn->refcount > 0) return; edbus_connection_name_gc(conn, cn); }