diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-07-23 15:18:09 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-07-23 15:18:09 -0400 |
commit | 76fa0298351ead5a7266f746b03cef22ef715383 (patch) | |
tree | 56bacfe052a49e2fe55092c295e7345dcaeb8dee /scripts | |
parent | scripts/revdep-pax: add python2/3 compat raw_input() (diff) | |
download | elfix-76fa0298351ead5a7266f746b03cef22ef715383.tar.gz elfix-76fa0298351ead5a7266f746b03cef22ef715383.tar.bz2 elfix-76fa0298351ead5a7266f746b03cef22ef715383.zip |
scripts/revdep-pax: simplify map reversal using setdefault
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/revdep-pax | 5 |
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 |