From 0d5e17af7391fb0d3a3c695dac40f8df41f8b11c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 30 Sep 2014 04:33:42 +0200 Subject: scripts: Use named variables instead of using the topic variable Switch code that uses roughly more explicit instances of the topic variable than implicit ones. Addresses BuiltinFunctions::ProhibitUselessTopic. Warned-by: perlcritic --- scripts/Dpkg/Control/HashCore.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/Dpkg/Control/HashCore.pm') diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm index 3128f788c..04cbdee9b 100644 --- a/scripts/Dpkg/Control/HashCore.pm +++ b/scripts/Dpkg/Control/HashCore.pm @@ -510,8 +510,8 @@ sub DELETE { sub FIRSTKEY { my $self = shift; my $parent = $self->[1]; - foreach (@{$parent->{in_order}}) { - return $_ if exists $self->[0]->{lc($_)}; + foreach my $key (@{$parent->{in_order}}) { + return $key if exists $self->[0]->{lc $key}; } } @@ -519,11 +519,11 @@ sub NEXTKEY { my ($self, $last) = @_; my $parent = $self->[1]; my $found = 0; - foreach (@{$parent->{in_order}}) { + foreach my $key (@{$parent->{in_order}}) { if ($found) { - return $_ if exists $self->[0]->{lc($_)}; + return $key if exists $self->[0]->{lc $key}; } else { - $found = 1 if $_ eq $last; + $found = 1 if $key eq $last; } } return; -- cgit v1.2.3