diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-05-11 16:42:52 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-05-11 23:50:40 +0000 |
commit | b55d801392b44bfe1e5383536ba7e2dd2e952cba (patch) | |
tree | 0fa6475740bb4036b398a04d8c965e3e2d6356c6 /ui/qt/display_filter_edit.cpp | |
parent | 61749e545030c9733cf9aa00d897040e59deabe2 (diff) |
Speed up display filter completion.
Don't loop over non-matching fields. This improves completion performance
considerably on Windows (where it was noticeable).
Change-Id: I7f526fe960c5c41da5ae847b04be25d65ca42bb1
Reviewed-on: https://code.wireshark.org/review/8418
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/display_filter_edit.cpp')
-rw-r--r-- | ui/qt/display_filter_edit.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/qt/display_filter_edit.cpp b/ui/qt/display_filter_edit.cpp index 5742ad9dba..ebc7134fd7 100644 --- a/ui/qt/display_filter_edit.cpp +++ b/ui/qt/display_filter_edit.cpp @@ -447,8 +447,9 @@ void DisplayFilterEdit::buildCompletionList(const QString &field_word) if (!proto_is_protocol_enabled(protocol)) continue; // Don't complete the current word. - const char *pfname = proto_get_protocol_filter_name(proto_id); - if (field_word.compare(pfname)) field_list << pfname; + const QString pfname = proto_get_protocol_filter_name(proto_id); + if (!field_word.startsWith(pfname)) continue; + field_list << pfname; if (show_fields) { void *field_cookie; for (header_field_info *hfinfo = proto_get_first_protocol_field(proto_id, &field_cookie); hfinfo; hfinfo = proto_get_next_protocol_field(proto_id, &field_cookie)) { |