From 80a360021077dc3a7f606375dc9219dbf7b01a6c Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 1 May 2024 17:30:21 +0800 Subject: [PATCH] shared/install: use FOREACH_ARRAY for install_changes_have_modification --- src/shared/install.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/install.h b/src/shared/install.h index 8cce6dddfe..13d163030c 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; }