From 63c49337e2f56aa18e495396eb6b8d3d4a7d7e3a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 20 Jul 2011 01:04:00 -0700 Subject: Optimize LinkageMapELF.findConsumers(). If there are no non-excluded providers then there's no need to search for satisfied consumers. --- pym/portage/util/_dyn_libs/LinkageMapELF.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'pym/portage/util/_dyn_libs') 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: -- cgit v1.2.3-1-g7c22