projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1c615a
)
Make best() return early when it's only given one packages.
author
Zac Medico
<zmedico@gentoo.org>
Wed, 22 Aug 2007 20:40:37 +0000
(20:40 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Wed, 22 Aug 2007 20:40:37 +0000
(20:40 -0000)
svn path=/main/trunk/; revision=7664
pym/portage/versions.py
patch
|
blob
|
history
diff --git
a/pym/portage/versions.py
b/pym/portage/versions.py
index b51b53ae543cb91a871064cb92983d1e453c9099..d4699d1ab7103d303cd9ddb63037a20212416254 100644
(file)
--- a/
pym/portage/versions.py
+++ b/
pym/portage/versions.py
@@
-306,10
+306,10
@@
def catsplit(mydep):
def best(mymatches):
"""Accepts None arguments; assumes matches are valid."""
- if mymatches is None:
- return ""
- if not len(mymatches):
+ if not mymatches:
return ""
+ if len(mymatches) == 1:
+ return mymatches[0]
bestmatch = mymatches[0]
p2 = catpkgsplit(bestmatch)[1:]
for x in mymatches[1:]: