[entropy.client.interfaces.dep] use set intersection instead of doubly nested for loops

This commit is contained in:
Fabio Erculiani
2011-05-31 11:13:30 +02:00
parent c1197fa99f
commit 8f96964beb
+3 -7
View File
@@ -1223,13 +1223,9 @@ class CalculatorsMixin:
# too much generic and could pull in conflicting packages.
# NOTE: this is a hack and real weighted graph would be required
mymatches, rc = self.atom_match(key, match_slot = slot,
multi_match = True)
got_it = None
for xmymatch in mymatches:
if xmymatch in elements_cache:
got_it = xmymatch
break
if got_it is not None:
multi_match = True, multi_repo = True)
got_it = mymatches & elements_cache
if got_it:
if const_debug_enabled():
atom = self.open_repository(mymatch[1]).retrieveAtom(
mymatch[0])