manager: minor manager_get_show_status() simplification
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Jan 2018 18:52:29 +0000 (19:52 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Jan 2018 18:52:29 +0000 (19:52 +0100)
Since the the whole function ultimately is just a fancy getter for the
show_status field, let's actually return it as last step literally
without an extra needless "if".

src/core/manager.c

index f764fb5..b58f345 100644 (file)
@@ -3548,10 +3548,7 @@ static bool manager_get_show_status(Manager *m, StatusType type) {
         if (type != STATUS_TYPE_EMERGENCY && manager_check_ask_password(m) > 0)
                 return false;
 
-        if (m->show_status > 0)
-                return true;
-
-        return false;
+        return m->show_status > 0;
 }
 
 const char *manager_get_confirm_spawn(Manager *m) {