summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-11-22 00:56:42 +0100
committermathieui <mathieui@mathieui.net>2012-11-22 00:56:42 +0100
commit25de0663bc6cab271c56ae7eca452a403bc2a0de (patch)
tree7ac2f0a6b112edd68384a57bae7eb0ece325e8a4 /src/tabs.py
parent4a7e08f1c2ffb3780bd21e9ecbbcbaaf2d32f742 (diff)
downloadpoezio-25de0663bc6cab271c56ae7eca452a403bc2a0de.tar.gz
poezio-25de0663bc6cab271c56ae7eca452a403bc2a0de.tar.bz2
poezio-25de0663bc6cab271c56ae7eca452a403bc2a0de.tar.xz
poezio-25de0663bc6cab271c56ae7eca452a403bc2a0de.zip
Fix the slow search
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py4
1 files changed, 3 insertions, 1 deletions
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):