diff --git a/src/calls-contacts-provider.c b/src/calls-contacts-provider.c index 5ae014a..5652359 100644 --- a/src/calls-contacts-provider.c +++ b/src/calls-contacts-provider.c @@ -417,7 +417,7 @@ CallsBestMatch * calls_contacts_provider_lookup_id (CallsContactsProvider *self, const char *id) { - g_autoptr (CallsBestMatch) best_match = NULL; + CallsBestMatch *best_match; g_return_val_if_fail (CALLS_IS_CONTACTS_PROVIDER (self), NULL); @@ -426,11 +426,8 @@ calls_contacts_provider_lookup_id (CallsContactsProvider *self, best_match = g_hash_table_lookup (self->best_matches, id); - if (best_match) { - g_object_ref (best_match); - - return g_steal_pointer (&best_match); - } + if (best_match) + return g_object_ref (best_match); best_match = calls_best_match_new (id); @@ -438,9 +435,9 @@ calls_contacts_provider_lookup_id (CallsContactsProvider *self, best_match, "country-code", G_BINDING_SYNC_CREATE); - g_hash_table_insert (self->best_matches, g_strdup (id), g_object_ref (best_match)); + g_hash_table_insert (self->best_matches, g_strdup (id), best_match); - return g_steal_pointer (&best_match); + return g_object_ref (best_match); } /**