From 3985d7267066d8686526562a84df337282282b4d Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 23 Mar 2009 12:06:33 +0900 Subject: [PATCH] fix slowdown due to new splitting --- ankiqt/ui/cardlist.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index deab6aa47..a1d76998f 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -106,11 +106,12 @@ class DeckModel(QAbstractTableModel): d = {'str': [], 'tag': [], } - for elem in search.split(" "): - if len(elem) > 2 and elem.startswith("t:"): - d['tag'].append(elem[2:]) - else: - d['str'].append(elem) + if search: + for elem in search.split(): + if len(elem) > 2 and elem.startswith("t:"): + d['tag'].append(elem[2:]) + else: + d['str'].append(elem) return d def showMatching(self):