libnm: drop two unnecessary NM_IS_OBJECT() checks

Now that NMRemoteConnection is an NMObject, the code only creates
NMObjects, so we don't need that check.
This commit is contained in:
Dan Winship 2014-09-08 14:18:05 -04:00
parent a59136878a
commit f3c02058d4

View file

@ -554,8 +554,7 @@ _nm_object_create (GType type, DBusGConnection *connection, const char *path)
object = g_object_new (type,
NM_OBJECT_PATH, path,
NULL);
if (NM_IS_OBJECT (object))
_nm_object_cache_add (NM_OBJECT (object));
_nm_object_cache_add (NM_OBJECT (object));
if (!g_initable_init (G_INITABLE (object), NULL, &error)) {
dbgmsg ("Could not create object for %s: %s", path, error->message);
g_error_free (error);
@ -624,8 +623,7 @@ async_got_type (GType type, gpointer user_data)
object = g_object_new (type,
NM_OBJECT_PATH, async_data->path,
NULL);
if (NM_IS_OBJECT (object))
_nm_object_cache_add (NM_OBJECT (object));
_nm_object_cache_add (NM_OBJECT (object));
g_async_initable_init_async (G_ASYNC_INITABLE (object), G_PRIORITY_DEFAULT,
NULL, async_inited, async_data);
}