[gnome-calendar] source-dialog: avoid unneeded comparisons



commit 2677ec560aeb79c0f4a737bbc2ba68db88fbb3c8
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 76a0860..b6038f2 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]