summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-07-20 01:04:00 -0700
committerZac Medico <zmedico@gentoo.org>2011-07-20 01:04:00 -0700
commit63c49337e2f56aa18e495396eb6b8d3d4a7d7e3a (patch)
tree0ce565955a568a02d3790408fde996134921fd9d
parent31f7e4afee0255d93fbb7eb6c90ba719943cb883 (diff)
downloadportage-63c49337e2f56aa18e495396eb6b8d3d4a7d7e3a.tar.gz
portage-63c49337e2f56aa18e495396eb6b8d3d4a7d7e3a.tar.bz2
portage-63c49337e2f56aa18e495396eb6b8d3d4a7d7e3a.zip
Optimize LinkageMapELF.findConsumers().
If there are no non-excluded providers then there's no need to search for satisfied consumers.
-rw-r--r--pym/portage/util/_dyn_libs/LinkageMapELF.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/pym/portage/util/_dyn_libs/LinkageMapELF.py b/pym/portage/util/_dyn_libs/LinkageMapELF.py
index 05043d708..218ce2a65 100644
--- a/pym/portage/util/_dyn_libs/LinkageMapELF.py
+++ b/pym/portage/util/_dyn_libs/LinkageMapELF.py
@@ -710,13 +710,14 @@ class LinkageMapELF(object):
relevant_dir_keys.add(
self._path_key(os.path.dirname(p)))
- for consumer_key in soname_node.consumers:
- _arch, _needed, path, _soname, _consumer_objs = \
- self._obj_properties[consumer_key]
- path_keys = defpath_keys.copy()
- path_keys.update(self._path_key(x) for x in path)
- if relevant_dir_keys.intersection(path_keys):
- satisfied_consumer_keys.add(consumer_key)
+ if relevant_dir_keys:
+ for consumer_key in soname_node.consumers:
+ _arch, _needed, path, _soname, _consumer_objs = \
+ self._obj_properties[consumer_key]
+ path_keys = defpath_keys.copy()
+ path_keys.update(self._path_key(x) for x in path)
+ if relevant_dir_keys.intersection(path_keys):
+ satisfied_consumer_keys.add(consumer_key)
rValue = set()
if soname_node is not None: