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-utils.c | |
parent | 6f61a85267013babe183fdd55eb46a06df491c47 (diff) | |
download | wireshark-a6de714ee1d179eb0e56e8d28b9aa6c27494af11.tar.gz |
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-utils.c')
-rw-r--r-- | epan/column-utils.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index 604587e3d1..d754084f25 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -328,41 +328,11 @@ col_custom_prime_edt(epan_dissect_t *edt, column_info *cinfo) for (i = cinfo->col_first[COL_CUSTOM]; i <= cinfo->col_last[COL_CUSTOM]; i++) { - int i_list = 0; - col_item = &cinfo->columns[i]; - col_custom_fields_ids_free(&col_item->col_custom_fields_ids); if (col_item->fmt_matx[COL_CUSTOM] && col_item->col_custom_dfilter) { epan_dissect_prime_dfilter(edt, col_item->col_custom_dfilter); - if (col_item->col_custom_fields) { - gchar **fields; - guint i_field = 0; - - /* Not using a GRegex here would improve performance. */ - fields = g_regex_split(cinfo->prime_regex, col_item->col_custom_fields, - G_REGEX_MATCH_ANCHORED); - - for (i_field =0; i_field < g_strv_length(fields); i_field += 1) { - if (fields[i_field] && *fields[i_field]) { - int id; - - header_field_info* hfinfo = proto_registrar_get_byname(fields[i_field]); - id = hfinfo ? hfinfo->id : -1; - if (id >= 0) { - int *idx; - - idx = g_new(int, 1); - *idx = id; - col_item->col_custom_fields_ids = - g_slist_insert(col_item->col_custom_fields_ids, idx, i_list); - i_list += 1; - } - } - } - g_strfreev(fields); - } } } } |