Kaynağa Gözat

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

Guillem Jover 11 yıl önce
ebeveyn
işleme
8e8c7b7fde
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  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};
     }