summaryrefslogtreecommitdiff
path: root/src/shared/net-condition.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-03-16 22:32:23 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-03-19 08:33:33 +0900
commitde010b0b2e50cf0b3837ce350b116bc92605f67a (patch)
tree226685fbb97461692562035501ebc21a314f718c /src/shared/net-condition.c
parent80a226b26b5e00a2ef9e85d1321da44cd14d051b (diff)
downloadsystemd-de010b0b2e50cf0b3837ce350b116bc92605f67a.tar.gz
strv: make iterator in STRV_FOREACH() declaread in the loop
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
Diffstat (limited to 'src/shared/net-condition.c')
-rw-r--r--src/shared/net-condition.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/shared/net-condition.c b/src/shared/net-condition.c
index b96cb60064..15e3d94ded 100644
--- a/src/shared/net-condition.c
+++ b/src/shared/net-condition.c
@@ -48,7 +48,6 @@ bool net_match_is_empty(const NetMatch *match) {
}
static bool net_condition_test_strv(char * const *patterns, const char *string) {
- char * const *p;
bool match = false, has_positive_rule = false;
if (strv_isempty(patterns))
@@ -79,7 +78,6 @@ static bool net_condition_test_ifname(char * const *patterns, const char *ifname
if (net_condition_test_strv(patterns, ifname))
return true;
- char * const *p;
STRV_FOREACH(p, alternative_names)
if (net_condition_test_strv(patterns, *p))
return true;
@@ -88,8 +86,6 @@ static bool net_condition_test_ifname(char * const *patterns, const char *ifname
}
static int net_condition_test_property(char * const *match_property, sd_device *device) {
- char * const *p;
-
if (strv_isempty(match_property))
return true;