From b2652ad70e9c8140d998ff47f3bbd52175faff5c Mon Sep 17 00:00:00 2001 From: Rafal Michalski Date: Wed, 27 Oct 2010 09:20:00 +0200 Subject: [PATCH] obexd: Remove redundant code in phonebook module Some extra code is redundant and not needed anymore. It is an effect of call history queries optimization. --- obexd/plugins/phonebook-tracker.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c index e037677b5..96290a496 100644 --- a/obexd/plugins/phonebook-tracker.c +++ b/obexd/plugins/phonebook-tracker.c @@ -949,24 +949,10 @@ static struct phonebook_contact *find_contact(GSList *contacts, const char *id) static struct phonebook_number *find_phone(GSList *numbers, const char *phone, int type) { - GSList *l = numbers; + GSList *l; struct phonebook_number *pb_num; - if (g_slist_length(l) == 1 && (pb_num = l->data) && - g_strcmp0(pb_num->tel, phone) == 0) { - - if ((type == TEL_TYPE_HOME || type == TEL_TYPE_WORK) && - pb_num->type == TEL_TYPE_OTHER) { - pb_num->type = type; - return pb_num; - } - - if (type == TEL_TYPE_OTHER && (pb_num->type == TEL_TYPE_HOME || - pb_num->type == TEL_TYPE_WORK)) - return pb_num; - } - - for (; l; l = l->next) { + for (l = numbers; l; l = l->next) { pb_num = l->data; /* Returning phonebook number if phone values and type values * are equal */ -- 2.47.3