[libsecret] Remove double check on collection_path in secret-collection.c



commit b9fbfbdb009b82c2f15d14265dfb14dd747d8532
Author: Garima Gaur <garima g samsung com>
Date:   Wed Dec 7 16:28:01 2016 +0530

    Remove double check on collection_path in secret-collection.c
    
    Signed-off-by: Stef Walter <stefw redhat com>
     * Most of the lines of change seem to be reindentation
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775747

 libsecret/secret-collection.c |   33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 deletions(-)
---
diff --git a/libsecret/secret-collection.c b/libsecret/secret-collection.c
index b691306..74b8393 100644
--- a/libsecret/secret-collection.c
+++ b/libsecret/secret-collection.c
@@ -2220,31 +2220,26 @@ secret_collection_for_alias_sync (SecretService *service,
 
        collection_path = secret_service_read_alias_dbus_path_sync (service, alias,
                                                                    cancellable, error);
+        /* No collection for this alias */
        if (collection_path == NULL)
                return NULL;
 
-       /* No collection for this alias */
-       if (collection_path == NULL) {
-               collection = NULL;
+       collection = _secret_service_find_collection_instance (service,
+                                                              collection_path);
 
-       } else {
-               collection = _secret_service_find_collection_instance (service,
-                                                                      collection_path);
-
-               if (collection != NULL) {
-
-                       /* Have a collection with all necessary flags */
-                       if (!collection_ensure_for_flags_sync (collection, flags,
-                                                              cancellable, error)) {
-                               g_object_unref (collection);
-                               collection = NULL;
-                       }
+       if (collection != NULL) {
 
-               /* No collection loaded, but valid path, load */
-               } else {
-                       collection = secret_collection_new_for_dbus_path_sync (service, collection_path,
-                                                                              flags, cancellable, error);
+               /* Have a collection with all necessary flags */
+               if (!collection_ensure_for_flags_sync (collection, flags,
+                                                      cancellable, error)) {
+                       g_object_unref (collection);
+                       collection = NULL;
                }
+
+       /* No collection loaded, but valid path, load */
+       } else {
+               collection = secret_collection_new_for_dbus_path_sync (service, collection_path,
+                                                                      flags, cancellable, error);
        }
 
        g_free (collection_path);


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