Fix the slow search
This commit is contained in:
parent
4a7e08f1c2
commit
25de0663bc
1 changed files with 3 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue