Speed up portage.config.keys()
authorAlec Warner <antarus@gentoo.org>
Fri, 7 Apr 2006 00:50:52 +0000 (00:50 -0000)
committerAlec Warner <antarus@gentoo.org>
Fri, 7 Apr 2006 00:50:52 +0000 (00:50 -0000)
svn path=/main/trunk/; revision=3086

pym/portage.py

index 2cfbed407f13dfd8dfc84c2f047cf624386dc0d8..d8e26cb9e71cb5df3724c0cfe9d58ffa745f3297 100644 (file)
@@ -1612,12 +1612,7 @@ class config:
                return bool(self.has_key(mykey))
 
        def keys(self):
-               mykeys=[]
-               for x in self.lookuplist:
-                       for y in x.keys():
-                               if y not in mykeys:
-                                       mykeys.append(y)
-               return mykeys
+               return unique_array(flatten([x.keys() for x in self.lookuplist]))
 
        def __setitem__(self,mykey,myvalue):
                "set a value; will be thrown away at reset() time"