commit:     5e86a968cf738a443d6c7d18bd1c7b22ad46ec18
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Jan  9 04:25:34 2026 +0000
Commit:     Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Fri Jan  9 04:25:34 2026 +0000
URL:        https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=5e86a968

Use min() again in generate_locales()

There was a time at which the List::Util module was only being imported
for its min() method, with the decision being made to drop it. As things
stand now, the List::Util module is being used for any() and first().
Hence, one might as well make use of min() again.

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

 locale-gen | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/locale-gen b/locale-gen
index 37d848f..f1f2e3f 100644
--- a/locale-gen
+++ b/locale-gen
@@ -11,7 +11,7 @@ use Errno qw(ENOENT);
 use File::Spec::Functions qw(canonpath catfile catdir path splitpath);
 use File::Temp qw(tempdir);
 use Getopt::Long ();
-use List::Util qw(any first);
+use List::Util qw(any first min);
 use Term::ANSIColor qw(colored);
 
 # Formally stable as of v5.40; sufficiently functional in both v5.36 and v5.38.
@@ -466,9 +466,7 @@ sub generate_locales ($workers, @locales) {
        local @SIG{'INT', 'TERM'} = ($handler, $handler);
 
        my $total = scalar @locales;
-       if ($total < $workers) {
-               $workers = $total;
-       }
+       $workers = min($workers, $total)
        printf "Compiling %d locale%s with %d worker%s ...\n",
                $total, plural($total), $workers, plural($workers);
 

Reply via email to