From: Zac Medico Date: Tue, 22 Sep 2009 22:30:49 +0000 (-0000) Subject: Optimize SlotDict.iteritems() a little. X-Git-Tag: v2.2_rc42~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cc9856b20d6d2188b4a54c419efc68f2aa627fa6;p=portage.git Optimize SlotDict.iteritems() a little. svn path=/main/trunk/; revision=14391 --- diff --git a/pym/portage/cache/mappings.py b/pym/portage/cache/mappings.py index 38a3bfe34..bd9f082b9 100644 --- a/pym/portage/cache/mappings.py +++ b/pym/portage/cache/mappings.py @@ -346,9 +346,10 @@ def slot_dict_class(keys, prefix="_val_"): return list(self) def iteritems(self): + prefix = self._prefix for k in self.allowed_keys: try: - yield (k, getattr(self, self._prefix + k)) + yield (k, getattr(self, prefix + k)) except AttributeError: pass