summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-20 17:36:18 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-20 17:36:18 +0000
commit39b38469dcf3a00623a2597db171b42bb98cc069 (patch)
treed121c1bfcfbde8fc2563ad03050183f548ca55cd
parentMake Atom use str.__eq__ and __ne__ also. (diff)
downloadportage-idfetch-39b38469dcf3a00623a2597db171b42bb98cc069.tar.gz
portage-idfetch-39b38469dcf3a00623a2597db171b42bb98cc069.tar.bz2
portage-idfetch-39b38469dcf3a00623a2597db171b42bb98cc069.zip
Make isvalidatom() use the Atom cache to avoid validating the same atom
twice. svn path=/main/trunk/; revision=10745
-rw-r--r--pym/portage/dep.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index 8a895878..43e34cdb 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -611,6 +611,9 @@ def isvalidatom(atom, allow_blockers=False):
1) 0 if the atom is invalid
2) 1 if the atom is valid
"""
+ existing_atom = Atom._atoms.get(atom)
+ if existing_atom is not None:
+ atom = existing_atom
if isinstance(atom, Atom):
if atom.blocker and not allow_blockers:
return 0