Bug 1338086 - Remove useless else blocks in order to reduce complexity in modules/libpref/ r?froydnj draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 09 Feb 2017 10:55:17 +0100
changeset 484415 a43087937bc3e974a5b8b2495f2c855a84bd3780
parent 484414 e169efa60f5841a15558cf045a325105f7b89d41
child 484416 9b06e634b58f6aa1d79ad0e68e9df59bca1de848
push id45470
push userbmo:sledru@mozilla.com
push dateWed, 15 Feb 2017 08:57:47 +0000
reviewersfroydnj
bugs1338086
milestone54.0a1
Bug 1338086 - Remove useless else blocks in order to reduce complexity in modules/libpref/ r?froydnj MozReview-Commit-ID: EGiX5NWdj6r
modules/libpref/prefapi.cpp
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -476,23 +476,21 @@ pref_CompareStrings(const void *v1, cons
 {
     char *s1 = *(char**) v1;
     char *s2 = *(char**) v2;
 
     if (!s1)
     {
         if (!s2)
             return 0;
-        else
-            return -1;
+        return -1;
     }
-    else if (!s2)
+    if (!s2)
         return 1;
-    else
-        return strcmp(s1, s2);
+    return strcmp(s1, s2);
 }
 
 bool PREF_HasUserPref(const char *pref_name)
 {
     if (!gHashTable)
         return false;
 
     PrefHashEntry *pref = pref_HashTableLookup(pref_name);