From: Zac Medico Date: Wed, 20 Jul 2011 08:04:00 +0000 (-0700) Subject: Optimize LinkageMapELF.findConsumers(). X-Git-Tag: v2.2.0_alpha47~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=63c49337e2f56aa18e495396eb6b8d3d4a7d7e3a;p=portage.git Optimize LinkageMapELF.findConsumers(). If there are no non-excluded providers then there's no need to search for satisfied consumers. --- 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: