Optimize SlotDict.iteritems() a little.
authorZac Medico <zmedico@gentoo.org>
Tue, 22 Sep 2009 22:30:49 +0000 (22:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 22 Sep 2009 22:30:49 +0000 (22:30 -0000)
svn path=/main/trunk/; revision=14391

pym/portage/cache/mappings.py

index 38a3bfe34e731031b74d5243826d408dab3e9ca4..bd9f082b9ab43878f41cadd41a69c64080c898d5 100644 (file)
@@ -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