aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-07-23 15:18:09 -0400
committerAnthony G. Basile <blueness@gentoo.org>2012-07-23 15:18:09 -0400
commit76fa0298351ead5a7266f746b03cef22ef715383 (patch)
tree56bacfe052a49e2fe55092c295e7345dcaeb8dee /scripts
parentscripts/revdep-pax: add python2/3 compat raw_input() (diff)
downloadelfix-76fa0298351ead5a7266f746b03cef22ef715383.tar.gz
elfix-76fa0298351ead5a7266f746b03cef22ef715383.tar.bz2
elfix-76fa0298351ead5a7266f746b03cef22ef715383.zip
scripts/revdep-pax: simplify map reversal using setdefault
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/revdep-pax5
1 files changed, 1 insertions, 4 deletions
diff --git a/scripts/revdep-pax b/scripts/revdep-pax
index d34acdc..b9fd83b 100755
--- a/scripts/revdep-pax
+++ b/scripts/revdep-pax
@@ -68,13 +68,10 @@ def get_forward_linkings():
def invert_linkings( forward_linkings ):
reverse_linkings = {}
- for binary in forward_linkings:
- for library in forward_linkings[binary]:
- reverse_linkings[library] = []
for binary in forward_linkings:
for library in forward_linkings[binary]:
- reverse_linkings[library].append(binary)
+ reverse_linkings.setdefault(library,[]).append(binary)
return reverse_linkings