[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 03/03: c/systemd: Optimise a loop



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 398387005ecec78dc1e429b3e0806d9020edcab6
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Oct 22 10:53:16 2016 +0000

    c/systemd: Optimise a loop
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/systemd.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/checks/systemd.pm b/checks/systemd.pm
index a2c1d27..a7ea9cd 100644
--- a/checks/systemd.pm
+++ b/checks/systemd.pm
@@ -43,9 +43,11 @@ sub run {
     my (undef, undef, $info) = @_;
 
     # non-service checks
-    for my $file ($info->sorted_index) {
-        if ($file =~ m,^etc/tmpfiles\.d/.*\.conf$,) {
-            tag 'systemd-tmpfiles.d-outside-usr-lib', $file;
+    if (my $tmpfiles = $info->index_resolved_path('etc/tmpfiles.d/')) {
+        for my $file ($tmpfiles->children('breadth-first')) {
+            if ($file->basename =~ m,\.conf$,) {
+                tag 'systemd-tmpfiles.d-outside-usr-lib', $file;
+            }
         }
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: