From 81f57e52f497411a562f593a5259f6d2b5010011 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 22 Aug 2007 20:40:37 +0000 Subject: Make best() return early when it's only given one packages. svn path=/main/trunk/; revision=7664 --- pym/portage/versions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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:]: -- cgit v1.2.3-1-g7c22