diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-12-21 21:11:48 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-12-22 05:17:02 +0000 |
commit | a6de714ee1d179eb0e56e8d28b9aa6c27494af11 (patch) | |
tree | acdcb3176969b03f6d03b4fa5e0dbd9eafebce7c /epan/column.c | |
parent | 6f61a85267013babe183fdd55eb46a06df491c47 (diff) |
ui: Optimize col_custom_prime_edt()
The col_item->col_custom_fields_ids list does not change between
packet so this can be initialized in build_column_format_array().
Change-Id: I171b583912dbd1568c3d85159fac1ab435dcaa7c
Reviewed-on: https://code.wireshark.org/review/12801
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/column.c')
-rw-r--r-- | epan/column.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/epan/column.c b/epan/column.c index a8037346d7..b6ffd1fd3b 100644 --- a/epan/column.c +++ b/epan/column.c @@ -872,6 +872,23 @@ build_column_format_array(column_info *cinfo, const gint num_cols, const gboolea col_item->col_custom_occurrence = 0; col_item->col_custom_dfilter = NULL; } + if (col_item->col_custom_fields) { + gchar **fields = g_regex_split(cinfo->prime_regex, col_item->col_custom_fields, + G_REGEX_MATCH_ANCHORED); + guint i_field; + + for (i_field = 0; i_field < g_strv_length(fields); i_field++) { + if (fields[i_field] && *fields[i_field]) { + header_field_info *hfinfo = proto_registrar_get_byname(fields[i_field]); + if (hfinfo) { + int *idx = g_new(int, 1); + *idx = hfinfo->id; + col_item->col_custom_fields_ids = g_slist_append(col_item->col_custom_fields_ids, idx); + } + } + } + g_strfreev(fields); + } } else { col_item->col_custom_fields = NULL; col_item->col_custom_occurrence = 0; |