[gnome-todo] eds: lower indentation with early return



commit ac1e521033023681ddd13a06a6851f2cbcffa0a3
Author: Victor Toso <me victortoso com>
Date:   Thu Oct 27 17:00:00 2016 +0200

    eds: lower indentation with early return
    
    Signed-off-by: Victor Toso <victortoso redhat com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773590

 plugins/eds/gtd-plugin-eds.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/plugins/eds/gtd-plugin-eds.c b/plugins/eds/gtd-plugin-eds.c
index f97969b..edca47c 100644
--- a/plugins/eds/gtd-plugin-eds.c
+++ b/plugins/eds/gtd-plugin-eds.c
@@ -133,25 +133,24 @@ gtd_plugin_eds_goa_account_removed_cb (GoaClient    *client,
                                        GtdPluginEds *self)
 {
   GoaAccount *account;
+  GList *l;
 
   account = goa_object_peek_account (object);
 
-  if (g_strv_contains (supported_accounts, goa_account_get_provider_type (account)))
+  if (!g_strv_contains (supported_accounts, goa_account_get_provider_type (account)))
+    return;
+
+  for (l = self->providers; l != NULL; l = l->next)
     {
-      GList *l;
+      if (!GTD_IS_PROVIDER_GOA (l->data))
+        continue;
 
-      for (l = self->providers; l != NULL; l = l->next)
+      if (account == gtd_provider_goa_get_account (l->data))
         {
-          if (!GTD_IS_PROVIDER_GOA (l->data))
-            continue;
+          self->providers = g_list_remove (self->providers, l->data);
 
-          if (account == gtd_provider_goa_get_account (l->data))
-            {
-              self->providers = g_list_remove (self->providers, l->data);
-
-              g_signal_emit_by_name (self, "provider-removed", l->data);
-              break;
-            }
+          g_signal_emit_by_name (self, "provider-removed", l->data);
+          break;
         }
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]