From cedc4412311d4a0e137227eb3896fe5802a95118 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 16 Mar 2012 20:11:50 +0000 Subject: (listlenght,uniq) enable perl_checker to see how many arguments are expected --- URPM/Resolve.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 0d8b37c..febf7fa 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -11,9 +11,17 @@ use Config; # perl_checker: require URPM #- a few functions from MDK::Common copied here: -sub listlength { scalar @_ } +sub listlength { + my (@l) = @_; + scalar @l; +} sub min { my $n = shift; $_ < $n and $n = $_ foreach @_; $n } -sub uniq { my %l; $l{$_} = 1 foreach @_; grep { delete $l{$_} } @_ } +sub uniq { + my (@l) = @_; + my %l; + $l{$_} = 1 foreach @l; + grep { delete $l{$_} } @l; +} sub find(&@) { my $f = shift; $f->($_) and return $_ foreach @_; -- cgit v1.2.1