[proto.c] proto_all_finfos(), pre-allocate array to hold all fields.

Change-Id: I0d41e417e57e656ccee1c2ce6bd406af4ed23d10
Reviewed-on: https://code.wireshark.org/review/17948
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
AndersBroman 2016-09-27 11:01:14 +02:00 committed by Anders Broman
parent 73a0ee0e41
commit 5972c3d529
1 changed files with 2 additions and 1 deletions

View File

@ -8449,7 +8449,8 @@ proto_all_finfos(proto_tree *tree)
{
ffdata_t ffdata;
ffdata.array = g_ptr_array_new();
/* Pre allocate enough space to hold all fields in most cases */
ffdata.array = g_ptr_array_sized_new(512);
ffdata.id = 0;
proto_tree_traverse_pre_order(tree, every_finfo, &ffdata);