diff options
author | Guillem Jover <guillem@debian.org> | 2014-07-27 19:49:58 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-08-09 23:04:37 +0200 |
commit | 543ac69d2470e39f6b95a59b82fee116bc1b90d7 (patch) | |
tree | e4230e479d3d7eba0c3adc300f62ca3dc8bb21b6 /scripts/dpkg-shlibdeps.pl | |
parent | 0efb836c42e264dfe60cc1db9d605ef608be5524 (diff) | |
download | dpkg-543ac69d2470e39f6b95a59b82fee116bc1b90d7.tar.gz |
scripts: Use //= instead of explicit defined or exists checks
Diffstat (limited to 'scripts/dpkg-shlibdeps.pl')
-rwxr-xr-x | scripts/dpkg-shlibdeps.pl | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 6f7c9ac51..ccd5980c2 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -244,10 +244,8 @@ foreach my $file (keys %exec) { if (defined($symfile_path)) { # Load symbol information print "Using symbols file $symfile_path for $soname\n" if $debug; - unless (exists $symfile_cache{$symfile_path}) { - $symfile_cache{$symfile_path} = - Dpkg::Shlibs::SymbolFile->new(file => $symfile_path); - } + $symfile_cache{$symfile_path} //= + Dpkg::Shlibs::SymbolFile->new(file => $symfile_path); $symfile->merge_object_from_symfile($symfile_cache{$symfile_path}, $soname); } if (defined($symfile_path) && $symfile->has_object($soname)) { @@ -267,9 +265,7 @@ foreach my $file (keys %exec) { } else { # No symbol file found, fall back to standard shlibs print "Using shlibs+objdump for $soname (file $lib)\n" if $debug; - unless (exists $objdump_cache{$lib}) { - $objdump_cache{$lib} = Dpkg::Shlibs::Objdump::Object->new($lib); - } + $objdump_cache{$lib} //= Dpkg::Shlibs::Objdump::Object->new($lib); my $libobj = $objdump_cache{$lib}; my $id = $dumplibs_wo_symfile->add_object($libobj); if (($id ne $soname) and ($id ne $lib)) { @@ -308,7 +304,7 @@ foreach my $file (keys %exec) { foreach (@sonames) { # Initialize statistics $soname_used{$_} = 0; - $global_soname_used{$_} = 0 unless exists $global_soname_used{$_}; + $global_soname_used{$_} //= 0; if (exists $global_soname_needed{$_}) { push @{$global_soname_needed{$_}}, $file; } else { |