tree-wide: use !strv_isempty() instead of strv_length() > 0
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 15 Dec 2017 07:36:35 +0000 (16:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 19 Dec 2017 01:43:57 +0000 (10:43 +0900)
src/core/execute.c
src/notify/notify.c
src/shared/ask-password-api.c
src/shared/bus-unit-util.c

index b91f654..aa9120b 100644 (file)
@@ -4162,19 +4162,19 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
         if (c->pam_name)
                 fprintf(f, "%sPAMName: %s\n", prefix, c->pam_name);
 
-        if (strv_length(c->read_write_paths) > 0) {
+        if (!strv_isempty(c->read_write_paths)) {
                 fprintf(f, "%sReadWritePaths:", prefix);
                 strv_fprintf(f, c->read_write_paths);
                 fputs("\n", f);
         }
 
-        if (strv_length(c->read_only_paths) > 0) {
+        if (!strv_isempty(c->read_only_paths)) {
                 fprintf(f, "%sReadOnlyPaths:", prefix);
                 strv_fprintf(f, c->read_only_paths);
                 fputs("\n", f);
         }
 
-        if (strv_length(c->inaccessible_paths) > 0) {
+        if (!strv_isempty(c->inaccessible_paths)) {
                 fprintf(f, "%sInaccessiblePaths:", prefix);
                 strv_fprintf(f, c->inaccessible_paths);
                 fputs("\n", f);
index 3e511b7..4a34e1e 100644 (file)
@@ -179,7 +179,7 @@ int main(int argc, char* argv[]) {
                 goto finish;
         }
 
-        if (strv_length(final_env) <= 0) {
+        if (strv_isempty(final_env)) {
                 r = 0;
                 goto finish;
         }
index 17928a9..346d8c9 100644 (file)
@@ -656,7 +656,7 @@ int ask_password_agent(
                                 goto finish;
                         }
 
-                        if (strv_length(l) <= 0) {
+                        if (strv_isempty(l)) {
                                 l = strv_free(l);
                                 log_debug("Invalid packet");
                                 continue;
index 8af738d..372e431 100644 (file)
@@ -1269,7 +1269,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
                 if (r < 0)
                         return r;
 
-                if (strv_length(l) > 0) {
+                if (!strv_isempty(l)) {
 
                         r = sd_bus_message_open_container(m, 'r', "sasb");
                         if (r < 0)