X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo%2FVersion.pm;h=e1f76742748fd777436c47b9af84068a81e76366;hp=8d70ee6501d6ec65aea44ef10a863ed4d55fe5d5;hb=7bee20385150f2ebb608178ecdce3851cdc4f54f;hpb=767226606d8814fe22df55137330473be0b5c0cf diff --git a/lib/CPANPLUS/Dist/Gentoo/Version.pm b/lib/CPANPLUS/Dist/Gentoo/Version.pm index 8d70ee6..e1f7674 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Version.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Version.pm @@ -126,12 +126,15 @@ sub _spaceship { my @a = @{ $v1->version }; my @b = @{ $v2->version }; - while (@a or @b) { - my $x = shift(@a) || 0; - my $y = shift(@b) || 0; + while (@a and @b) { + my $x = shift @a; + my $y = shift @b; my $c = $x <=> $y; return $c if $c; } + + return 1 if @a; + return -1 if @b; } {