From c0cfcc8a6eb2e4adff8eb3d3bb9f44d9b7124ccd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 22 Jun 2007 01:53:50 +0000 Subject: Remove lots of unnecessary list generation via dict.keys(). (trunk r6911) svn path=/main/branches/2.1.2/; revision=6930 --- bin/emerge | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bin/emerge') diff --git a/bin/emerge b/bin/emerge index 4e3197bf0..c2053c0a9 100755 --- a/bin/emerge +++ b/bin/emerge @@ -439,7 +439,7 @@ class search: if self.searchre.search(full_desc): self.matches["desc"].append([full_package,masked]) self.mlen=0 - for mtype in self.matches.keys(): + for mtype in self.matches: self.matches[mtype].sort() self.mlen += len(self.matches[mtype]) @@ -448,7 +448,7 @@ class search: print "\b\b \n[ Results for search key : "+white(self.searchkey)+" ]" print "[ Applications found : "+white(str(self.mlen))+" ]" print " " - for mtype in self.matches.keys(): + for mtype in self.matches: for match,masked in self.matches[mtype]: if mtype=="pkg": catpack=match @@ -2182,7 +2182,7 @@ class depgraph: mylist = getlist(self.settings, "system") worlddict=genericdict(worldlist) - for x in worlddict.keys(): + for x in worlddict: if not portage.isvalidatom(x): world_problems = True continue @@ -2665,7 +2665,7 @@ class depgraph: if myfilesdict is None: myfilesdict="[empty/missing/bad digest]" else: - for myfetchfile in myfilesdict.keys(): + for myfetchfile in myfilesdict: if myfetchfile not in myfetchlist: mysize+=myfilesdict[myfetchfile] myfetchlist.append(myfetchfile) @@ -3554,7 +3554,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files, if not slotmap.has_key(myslot): slotmap[myslot]={} slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg - for myslot in slotmap.keys(): + for myslot in slotmap: counterkeys=slotmap[myslot].keys() counterkeys.sort() if not counterkeys: @@ -3581,7 +3581,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files, finally: if vdb_lock: portage_locks.unlockdir(vdb_lock) - for x in pkgmap.keys(): + for x in pkgmap: for y in localtree.dep_match(x): if y not in pkgmap[x]["omitted"] and \ y not in pkgmap[x]["selected"] and \ @@ -3637,7 +3637,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files, if not autoclean: countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging") - for x in pkgmap.keys(): + for x in pkgmap: for y in pkgmap[x]["selected"]: print ">>> Unmerging "+y+"..." emergelog(xterm_titles, "=== Unmerging... ("+y+")") -- cgit v1.2.3-1-g7c22