minor performance improvement
authorMarius Mauch <genone@gentoo.org>
Wed, 10 Jan 2007 10:02:52 +0000 (10:02 -0000)
committerMarius Mauch <genone@gentoo.org>
Wed, 10 Jan 2007 10:02:52 +0000 (10:02 -0000)
svn path=/main/trunk/; revision=5518

pym/portage_dep.py

index edf62522bb00e5327c2d849e14af0c6663b10b20..95ae4b640ab02712add4112dd8695f689ae7aacc 100644 (file)
@@ -583,12 +583,12 @@ def match_from_list(mydep, candidate_list):
                mylist = [cpv for cpv in candidate_list if cpvequal(cpv, mycpv)]
 
        elif operator == "=*": # glob match
+               # XXX: Nasty special casing for leading zeros
+               # Required as =* is a literal prefix match, so can't 
+               # use vercmp
+               mysplit = catpkgsplit(mycpv)
+               mycpv = mysplit[0]+"/"+mysplit[1]+"-"+mysplit[2].lstrip("0")
                for x in candidate_list:
-                       # XXX: Nasty special casing for leading zeros
-                       # Required as =* is a literal prefix match, so can't 
-                       # use vercmp
-                       mysplit = catpkgsplit(mycpv)
-                       mycpv = mysplit[0]+"/"+mysplit[1]+"-"+mysplit[2].lstrip("0")
                        xs = catpkgsplit(x)
                        xcpv = xs[0]+"/"+xs[1]+"-"+xs[2].lstrip("0")
                        xcpv = x[:min(len(x), len(mycpv))]