Make isvalidatom() use the Atom cache to avoid validating the same atom
authorZac Medico <zmedico@gentoo.org>
Fri, 20 Jun 2008 17:36:18 +0000 (17:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 20 Jun 2008 17:36:18 +0000 (17:36 -0000)
twice.

svn path=/main/trunk/; revision=10745

pym/portage/dep.py

index 8a89587887cd79eef3d267ad207a237c1c7753f6..43e34cdb7f504ee8005e31ddb34f4973c39bf6cc 100644 (file)
@@ -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