Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 2/2] Remove redundant code in phonebook module
@ 2010-10-27  8:53 Rafał Michalski
  2010-10-27 13:51 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Rafał Michalski @ 2010-10-27  8:53 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafał Michalski

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0002-Remove-redundant-code-in-phonebook-module.patch --]
[-- Type: text/x-patch, Size: 1448 bytes --]

From 93465ab642893a508b8543edc4919a1bcd47436b Mon Sep 17 00:00:00 2001
From: Rafal Michalski <michalski.raf@gmail.com>
Date: Wed, 27 Oct 2010 09:20:00 +0200
Subject: [PATCH 2/2] Remove redundant code in phonebook module

Some extra code is redundant and not needed anymore. It is an effect
of call history queries optimization.
---
 plugins/phonebook-tracker.c |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index e037677..96290a4 100644
--- a/plugins/phonebook-tracker.c
+++ b/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 */
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] Remove redundant code in phonebook module
  2010-10-27  8:53 [PATCH 2/2] Remove redundant code in phonebook module Rafał Michalski
@ 2010-10-27 13:51 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-10-27 13:51 UTC (permalink / raw)
  To: Rafał Michalski; +Cc: linux-bluetooth

Hi Rafal,

On Wed, Oct 27, 2010, Rafał Michalski wrote:
> Some extra code is redundant and not needed anymore. It is an effect
> of call history queries optimization.
> ---
>  plugins/phonebook-tracker.c |   18 ++----------------
>  1 files changed, 2 insertions(+), 16 deletions(-)

This patch has also been pushed upstream. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-27 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27  8:53 [PATCH 2/2] Remove redundant code in phonebook module Rafał Michalski
2010-10-27 13:51 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox