From: Mike Yuan Date: Wed, 1 May 2024 09:30:21 +0000 (+0800) Subject: shared/install: use FOREACH_ARRAY for install_changes_have_modification X-Git-Tag: v256-rc2~135^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80a360021077dc3a7f606375dc9219dbf7b01a6c;p=thirdparty%2Fsystemd.git shared/install: use FOREACH_ARRAY for install_changes_have_modification --- diff --git a/src/shared/install.h b/src/shared/install.h index 8cce6dddfe2..13d163030c7 100644 --- a/src/shared/install.h +++ b/src/shared/install.h @@ -63,9 +63,9 @@ struct InstallChange { char *source; }; -static inline bool install_changes_have_modification(const InstallChange* changes, size_t n_changes) { - for (size_t i = 0; i < n_changes; i++) - if (IN_SET(changes[i].type, INSTALL_CHANGE_SYMLINK, INSTALL_CHANGE_UNLINK)) +static inline bool install_changes_have_modification(const InstallChange *changes, size_t n_changes) { + FOREACH_ARRAY(i, changes, n_changes) + if (IN_SET(i->type, INSTALL_CHANGE_SYMLINK, INSTALL_CHANGE_UNLINK)) return true; return false; }