diff options
author | Kai A. Hiller <V02460@gmail.com> | 2023-03-07 22:44:26 +0100 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2023-03-12 09:33:23 +0000 |
commit | 409588066557b1b47b805261d95925691bc83660 (patch) | |
tree | ea115f6f7a3e683dbb9dfbff215f770e3a5d2a16 | |
parent | 2e643161bd21791433bb37bbcd88d5dd586e486a (diff) | |
download | gnome-contacts-409588066557b1b47b805261d95925691bc83660.tar.gz |
contacts-query-filter: Remove invalid optimization
The current `QueryFilter` code performs an invalid optimization on
search query updates by assuming a `FilterChange` of
MORE_STRICT/LESS_STRICT when it should be DIFFERENT:
- If the search string is extended, fewer contacts qualify for matching,
but some might start to pass the threshold.
- If the search string is shrunk, more contacts qualify for matching,
but some might no longer pass the threshold.
-rw-r--r-- | src/contacts-query-filter.vala | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/contacts-query-filter.vala b/src/contacts-query-filter.vala index 81cae41..a56651c 100644 --- a/src/contacts-query-filter.vala +++ b/src/contacts-query-filter.vala @@ -74,17 +74,6 @@ public class Contacts.QueryFilter : Gtk.Filter { // We shouldn't get a notify for this but in reality we do, so ignore it if (this.query_string == old_query_str) return; - - if (this.query_string.length > old_query_str.length && - this.query_string.index_of (old_query_str) != -1) { - this.changed (Gtk.FilterChange.MORE_STRICT); - return; - } - if (this.query_string.length < old_query_str.length && - old_query_str.index_of (this.query_string) != -1) { - this.changed (Gtk.FilterChange.LESS_STRICT); - return; - } } } |