Use a set instead of a list for better efficiency.
authorZac Medico <zmedico@gentoo.org>
Tue, 18 Jul 2006 03:59:26 +0000 (03:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 18 Jul 2006 03:59:26 +0000 (03:59 -0000)
svn path=/main/trunk/; revision=3916

bin/emerge

index 9fc2daba84b8e9e7061ff730b56cee7334376198..90ec7e4358db3512731ee607fe3d7457f7b95783 100755 (executable)
@@ -3234,7 +3234,7 @@ def action_depclean(settings, trees, ldpath_mtimes,
                print "!!! You have no dependencies. Impossible. Bug."
                sys.exit(1)
 
-       reallist=[]
+       reallist = set()
        explicitly_required = set()
        for x in alldeps:
                myparts=portage.catpkgsplit(string.split(x)[2])
@@ -3250,8 +3250,7 @@ def action_depclean(settings, trees, ldpath_mtimes,
                        continue
 
                catpack=myparts[0]+"/"+myparts[1]
-               if catpack not in reallist:
-                       reallist.append(catpack)
+               reallist.add(catpack)
                explicitly_required.add(x.split()[2])