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

Signed-off-by: Jean Delvare <jdelv...@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

_______________________________________________
Quilt-dev mailing list
Quilt-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to