From: Zac Medico Date: Sat, 31 May 2008 23:10:14 +0000 (-0000) Subject: Make PackageSet._setAtoms() use existing Atom instances when available. X-Git-Tag: v2.2_pre8~51 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=365f1798be06dded706488b8c372eed7465ebe8f;p=portage.git Make PackageSet._setAtoms() use existing Atom instances when available. svn path=/main/trunk/; revision=10523 --- 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):