quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] [PATCH 2/2] patches: Minor optimization to scan_unapplied


From: Jean Delvare
Subject: [Quilt-dev] [PATCH 2/2] patches: Minor optimization to scan_unapplied
Date: Wed, 24 Jul 2024 18:38:30 +0200
User-agent: Evolution 3.42.4

Prepare the search pattern in scan_unapplied outside the inner loop
for a small performance benefit.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 quilt/patches.in |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/quilt/patches.in
+++ b/quilt/patches.in
@@ -69,12 +69,12 @@ scan_unapplied()
        done
 
        # "Or" all files in a single pattern
-       file=\\\($(array_join \\\| "${files_bre[@]}")\\\)
+       file=^\\\($(array_join \\\| "${files_bre[@]}")\\\)\$
 
        for patch in "${patch_list[@]}"
        do
                if filenames_in_patch "$patch" \
-                  | grep -q "^$file\$"
+                  | grep -q "$file"
                then
                        echo "$color$prefix$(print_patch $patch)$color_clear"
                fi

-- 
Jean Delvare
SUSE L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]