From 25de0663bc6cab271c56ae7eca452a403bc2a0de Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 22 Nov 2012 00:56:42 +0100 Subject: Fix the slow search --- src/tabs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tabs.py b/src/tabs.py index da0a053e..a76489ea 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -2672,7 +2672,7 @@ class RosterInfoTab(Tab): return True def set_roster_filter_slow(self, txt): - roster.jids_filter = (jid_and_name_match_slow, txt) + roster.contact_filter = (jid_and_name_match_slow, txt) self.refresh() return False @@ -3337,6 +3337,8 @@ def diffmatch(search, string): be 'almost' found INSIDE a string. 'almost' being defined by difflib """ + if len(search) > len(string): + return False l = len(search) ratio = 0.7 for i in range(len(string) - l + 1): -- cgit v1.2.3