]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/install: use FOREACH_ARRAY for install_changes_have_modification
authorMike Yuan <me@yhndnzj.com>
Wed, 1 May 2024 09:30:21 +0000 (17:30 +0800)
committerMike Yuan <me@yhndnzj.com>
Wed, 1 May 2024 10:04:55 +0000 (18:04 +0800)
src/shared/install.h

index 8cce6dddfe2adff1af147ad296e89ad0e98d8ba2..13d163030c7011756bc28404fc295a6d65e30212 100644 (file)
@@ -63,9 +63,9 @@ struct InstallChange {
         char *source;
 };
 
-static inline bool install_changes_have_modification(const InstallChangechanges, 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;
 }