Explorar o código

Dpkg::Shlibs::SymbolFile: Use map instead of foreach to initialize the hash

Guillem Jover %!s(int64=11) %!d(string=hai) anos
pai
achega
8e8c7b7fde
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      scripts/Dpkg/Shlibs/SymbolFile.pm

+ 2 - 2
scripts/Dpkg/Shlibs/SymbolFile.pm

@@ -112,8 +112,8 @@ sub clear {
 
 sub clear_except {
     my ($self, @ids) = @_;
-    my %has;
-    $has{$_} = 1 foreach (@ids);
+
+    my %has = map { $_ => 1 } @ids;
     foreach my $objid (keys %{$self->{objects}}) {
 	delete $self->{objects}{$objid} unless exists $has{$objid};
     }