arm_pack_manager - Simplify find_device

pull/2708/head
Jimmy Brisson 2016-07-05 13:50:29 -05:00 committed by Sarah Marsh
parent b840a1b58f
commit b05964abbe
1 changed files with 1 additions and 2 deletions

View File

@ -205,8 +205,7 @@ class Cache () :
def find_device(self, match) :
choices = process.extract(match, self.index.keys(), limit=len(self.index))
choices = sorted([(v, k) for k, v in choices], reverse=True)
if not choices : return []
else : choices = list(takewhile(lambda t: t[0] == choices[0][0], choices))
if choices : choices = list(takewhile(lambda t: t[0] == choices[0][0], choices))
return [(v, self.index[v]) for k,v in choices]
def dump_index_to_file(self, file) :