From: Zac Medico Date: Wed, 22 Aug 2007 20:40:37 +0000 (-0000) Subject: Make best() return early when it's only given one packages. X-Git-Tag: v2.2_pre1~864 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=81f57e52f497411a562f593a5259f6d2b5010011;p=portage.git Make best() return early when it's only given one packages. svn path=/main/trunk/; revision=7664 --- diff --git a/pym/portage/versions.py b/pym/portage/versions.py index b51b53ae5..d4699d1ab 100644 --- 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:]: