font.eclass: font_cleanup_dirs: Use `has` instead of `for`
authorAndreas Sturmlechner <asturm@gentoo.org>
Tue, 15 Oct 2019 21:02:00 +0000 (23:02 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Wed, 16 Oct 2019 08:44:26 +0000 (10:44 +0200)
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
eclass/font.eclass

index 701621002845685262e51b8e52f5d74705d547b6..76c20549ea649ff3a8d521e1ee72049d30446932 100644 (file)
@@ -113,13 +113,11 @@ font_cleanup_dirs() {
                        generated=false
                        # make sure this is a file and not a subdir
                        [[ -e ${f} || -L ${f} ]] || continue
-                       for g in ${genfiles}; do
-                               if [[ ${f##*/} == ${g} ]]; then
-                                       # this is a generated file
-                                       generated=true
-                                       break
-                               fi
-                       done
+                       if has ${f##*/} ${genfiles}; then
+                               # this is a generated file
+                               generated=true
+                               break
+                       fi
                        # if the file is a generated file then we know this is a font dir (as
                        # opposed to something like encodings or util) and a candidate for
                        # removal.  if it's not generated then it's an "otherfile".