commit:     5d770d578e34cfeee5e23d8e52ecd6434c46e1fd
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Thu Aug 21 14:34:54 2025 +0000
Commit:     Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Thu Aug 21 14:34:54 2025 +0000
URL:        https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=5d770d57

Don't bother loading and using List::Util

As useful as the List::Util module can be, it's not worth loading it for
the sole purpose of clamping $workers to $total.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 locale-gen | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/locale-gen b/locale-gen
index 8c1fd53..33dad6e 100755
--- a/locale-gen
+++ b/locale-gen
@@ -14,7 +14,6 @@ use File::Spec::Functions qw(canonpath catfile catdir 
splitpath);
 use File::Temp qw(tempdir);
 use Getopt::Long ();
 use JSON::PP ();
-use List::Util qw(min);
 use POSIX qw(LC_ALL setlocale);
 
 # Formally stable as of v5.40; sufficiently functional in both v5.36 and v5.38.
@@ -424,7 +423,9 @@ sub generate_locales ($workers, @locales) {
        local @SIG{'INT', 'TERM'} = ($handler, $handler);
 
        my $total = scalar @locales;
-       $workers = min($workers, $total);
+       if ($total < $workers) {
+               $workers = $total;
+       }
        printf "Compiling %d locale%s with %d worker%s ...\n",
                $total, plural($total), $workers, plural($workers);
 

Reply via email to