summaryrefslogtreecommitdiffstats
path: root/src/libsystemd
diff options
context:
space:
mode:
authorIntegral <integral@member.fsf.org>2024-10-26 00:10:22 +0200
committerGitHub <noreply@github.com>2024-10-26 00:10:22 +0200
commitddb8a639d5d1f9a0ebfa790805703cf381a42459 (patch)
treeee6fcdfcecd1ab5c5e4840d41e901d73f1ec38a2 /src/libsystemd
parentMerge pull request #34884 from poettering/run0-disconnect-fix (diff)
downloadsystemd-ddb8a639d5d1f9a0ebfa790805703cf381a42459.tar.xz
systemd-ddb8a639d5d1f9a0ebfa790805703cf381a42459.zip
tree-wide: replace for loop with FOREACH_ELEMENT or FOREACH_ARRAY macros (#34893)
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-event/sd-event.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 26b28d7bcf..a2fd0de9e9 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -4858,13 +4858,13 @@ _public_ int sd_event_dispatch(sd_event *e) {
static void event_log_delays(sd_event *e) {
char b[ELEMENTSOF(e->delays) * DECIMAL_STR_MAX(unsigned) + 1], *p;
- size_t l, i;
+ size_t l;
p = b;
l = sizeof(b);
- for (i = 0; i < ELEMENTSOF(e->delays); i++) {
- l = strpcpyf(&p, l, "%u ", e->delays[i]);
- e->delays[i] = 0;
+ FOREACH_ELEMENT(delay, e->delays) {
+ l = strpcpyf(&p, l, "%u ", *delay);
+ *delay = 0;
}
log_debug("Event loop iterations: %s", b);
}