diff options
author | J Pipkin <j@dawnrazor.net> | 2013-03-30 12:20:26 -0500 |
---|---|---|
committer | J Pipkin <j@dawnrazor.net> | 2013-03-30 12:20:26 -0500 |
commit | 7c90f21cbea304210d113fad4d918cde72cb0eae (patch) | |
tree | 013053f70f3785f1d487a43c6aef38aa71b98600 | |
parent | d26ccbbcd5d2eb3f419b750c4ad93c43aed134a2 (diff) | |
download | sbotools2-7c90f21cbea304210d113fad4d918cde72cb0eae.tar.xz |
modification to last change for conciseness, and get rid of useless add_to_queue() prototype
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 13f5057..b34d6f5 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -924,10 +924,8 @@ sub get_requires($) { return $$info[0] ne '' ? $info : undef; } -# avoid being called to early to check prototype when add_to_queue calls itself -sub add_to_queue($); # used by get_build_queue. -sub add_to_queue($) { +sub add_to_queue { my $args = shift; my $sbo = \${$args}{NAME}; return unless $$sbo; @@ -958,12 +956,9 @@ sub get_build_queue { add_to_queue(\%args); } # Remove duplicate entries (leaving last occurrence) - @$temp_queue = reverse @$temp_queue; - my (%seen, @build_queue); - FIRST: for my $sb (@$temp_queue) { - next FIRST if $seen{$sb}++; - push @build_queue, $sb; - } + my @build_queue = reverse @$temp_queue; + my %seen; + @build_queue = grep {!$seen{$_}++} @build_queue; @build_queue = reverse @build_queue; return \@build_queue; } |