[gnome-calendar/calendar-editor] source-dialog: avoid unneeded comparisons
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/calendar-editor] source-dialog: avoid unneeded comparisons
- Date: Sat, 16 May 2015 22:15:09 +0000 (UTC)
commit 857ad67631569f9d1c2e8600b5d3e39f499aec6f
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Sat May 16 18:10:18 2015 -0400
source-dialog: avoid unneeded comparisons
Sources are unique, so the comparison can be avoided once the source is
found
src/gcal-source-dialog.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 1aceb38..9dd82da 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -281,7 +281,10 @@ add_source (GcalManager *manager,
for (l = children; l != NULL; l = l->next)
{
if (g_object_get_data (l->data, "source") == source)
- contains_source = TRUE;
+ {
+ contains_source = TRUE;
+ break;
+ }
}
if (!contains_source)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]