tree-wide: use strv_isempty() instead of strv_length() == 0

It's a lot faster in many cases, since it's O(1) rather than O(n).
This commit is contained in:
Lennart Poettering
2017-11-29 12:41:08 +01:00
parent 5716965132
commit 7b943bb7e3
5 changed files with 25 additions and 10 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ static void test_paths(UnitFileScope scope) {
assert_se(strv_length(lp_with_env.search_path) == 1);
assert_se(streq(lp_with_env.search_path[0], systemd_unit_path));
assert_se(lookup_paths_reduce(&lp_with_env) >= 0);
assert_se(strv_length(lp_with_env.search_path) == 0);
assert_se(strv_isempty(lp_with_env.search_path));
assert_se(rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0);
}