From ddb8a639d5d1f9a0ebfa790805703cf381a42459 Mon Sep 17 00:00:00 2001 From: Integral Date: Sat, 26 Oct 2024 06:10:22 +0800 Subject: tree-wide: replace for loop with FOREACH_ELEMENT or FOREACH_ARRAY macros (#34893) --- src/libsystemd/sd-event/sd-event.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libsystemd') 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); } -- cgit v1.2.3