[gnome-system-monitor] Small code refactoring



commit e15bf53471a6dbb1d86a17570addec9517a5c83d
Author: Jacob Barkdull <jacobbarkdull gmail com>
Date:   Mon Jan 6 15:33:20 2020 -0800

    Small code refactoring
    
    These if statements don't need to be nested like they were.

 src/procdialogs.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/procdialogs.cpp b/src/procdialogs.cpp
index e148b4f3..b0d2a548 100644
--- a/src/procdialogs.cpp
+++ b/src/procdialogs.cpp
@@ -293,14 +293,14 @@ multi_root_check (char *command)
 {
     if (procman_has_pkexec ()) {
         return gsm_pkexec_create_root_password_dialog (command);
-    } else {
-        if (procman_has_gksu ()) {
-            return gsm_gksu_create_root_password_dialog (command);
-        } else {
-            if (procman_has_gnomesu ()) {
-                return gsm_gnomesu_create_root_password_dialog (command);
-            }
-        }
+    }
+
+    if (procman_has_gksu ()) {
+        return gsm_gksu_create_root_password_dialog (command);
+    }
+
+    if (procman_has_gnomesu ()) {
+        return gsm_gnomesu_create_root_password_dialog (command);
     }
 
     return FALSE;


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