[carton] 200/472: Stop unnecessary deduplication

Lucas Kanashiro kanashiro-guest at moszumanska.debian.org
Fri Jul 24 00:38:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

kanashiro-guest pushed a commit to branch master
in repository carton.

commit fc2cb169d46d8f3811bcfd18a5002e013afd7ca0
Author: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
Date:   Thu May 30 16:38:01 2013 +0900

    Stop unnecessary deduplication
---
 lib/Carton.pm | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/lib/Carton.pm b/lib/Carton.pm
index af9763d..ecae3cb 100644
--- a/lib/Carton.pm
+++ b/lib/Carton.pm
@@ -52,26 +52,11 @@ sub list_dependencies {
     return map "$_~$hash->{$_}", grep { $_ ne 'perl' } keys %$hash;
 }
 
-sub dedupe_modules {
-    my($self, $modules) = @_;
-
-    my %seen;
-    my @result;
-    for my $spec (reverse @$modules) {
-        my($mod, $ver) = split /~/, $spec;
-        next if $seen{$mod}++;
-        push @result, $spec;
-    }
-
-    return [ reverse @result ];
-}
-
 
 sub download_from_cpanfile {
     my($self, $cpanfile, $local_mirror) = @_;
 
     my @modules = $self->list_dependencies;
-    my $modules = $self->dedupe_modules(\@modules);
 
     my $index = $self->build_index($self->lock->{modules});
     $self->build_mirror_file($index, $self->{mirror_file});
@@ -88,7 +73,7 @@ sub download_from_cpanfile {
         ( $mirror ne $DefaultMirror ? "--mirror-only" : () ),
         "--scandeps",
         "--save-dists", $local_mirror,
-        @$modules,
+        @modules,
     );
 }
 
@@ -96,7 +81,6 @@ sub install {
     my($self, $file, $cascade) = @_;
 
     my @modules = $self->list_dependencies;
-    my $modules = $self->dedupe_modules(\@modules);
 
     if ($self->lock) {
         my $index = $self->build_index($self->lock->{modules});
@@ -118,7 +102,7 @@ sub install {
         ( $is_default_mirror ? () : "--mirror-only" ),
         ( $self->lock ? ("--mirror-index", $self->{mirror_file}) : () ),
         ( $cascade ? "--cascade-search" : () ),
-        @$modules,
+        @modules,
     ) or die "Installing modules failed\n";
 }
 
@@ -175,7 +159,6 @@ sub build_packages {
     return @packages;
 }
 
-
 sub build_index {
     my($self, $modules) = @_;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/carton.git



More information about the Pkg-perl-cvs-commits mailing list