From 365f1798be06dded706488b8c372eed7465ebe8f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 31 May 2008 23:10:14 +0000 Subject: [PATCH] Make PackageSet._setAtoms() use existing Atom instances when available. svn path=/main/trunk/; revision=10523 --- pym/portage/sets/base.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py index d9f2a8d91..416626320 100644 --- a/pym/portage/sets/base.py +++ b/pym/portage/sets/base.py @@ -61,13 +61,18 @@ class PackageSet(object): self._atoms.clear() self._nonatoms.clear() for a in atoms: - a = a.strip() - if not a: - continue - try: - self._atoms.add(Atom(a)) - except InvalidAtom: - self._nonatoms.add(a) + if not isinstance(a, Atom): + if isinstance(a, basestring): + a = a.strip() + if not a: + continue + try: + a = Atom(a) + except InvalidAtom: + self._nonatoms.add(a) + continue + self._atoms.add(a) + self._updateAtomMap() def load(self): -- 2.26.2