summaryrefslogtreecommitdiff
path: root/services
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-02-11 04:35:20 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-02-11 04:35:20 +0100
commitdf7a03f16a68ee2fb12b668d4b665f9a337a9906 (patch)
treebe668efda0a1a84c13ec5d456f3ad864f6cfee38 /services
parent362fcdb17b1ad754c08d01349b679945cebab8a1 (diff)
PanelService: avoid to do unneeded loops when looking for an entry
(bzr r1858.11.8)
Diffstat (limited to 'services')
-rw-r--r--services/panel-service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/panel-service.c b/services/panel-service.c
index 8f1ec107d..a02c57c5f 100644
--- a/services/panel-service.c
+++ b/services/panel-service.c
@@ -318,6 +318,7 @@ get_indicator_entry_by_id (PanelService *self, const gchar *entry_id)
IndicatorObjectEntry *invalid_entry;
if (sscanf (entry_id, "%p", &invalid_entry) == 1)
{
+ gboolean entry_found = FALSE;
GSList *sl;
for (sl = self->priv->indicators; sl; sl = sl->next)
{
@@ -331,12 +332,16 @@ get_indicator_entry_by_id (PanelService *self, const gchar *entry_id)
if (l->data == invalid_entry)
{
entry = invalid_entry;
+ entry_found = TRUE;
g_warning ("Entry %p has been wrongly removed!", entry);
break;
}
}
g_list_free (entries);
+
+ if (entry_found)
+ break;
}
}
}