diff options
author | AndersBroman <anders.broman@ericsson.com> | 2016-09-27 11:01:14 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-09-27 10:20:20 +0000 |
commit | 5972c3d52960a737575ae9683316bef0890cf181 (patch) | |
tree | d59857bfd9395343b7327b1f3c5cb5bc5c1edd7d /epan/proto.c | |
parent | 73a0ee0e41ce9f561d4f440902dc3aebce3285c8 (diff) |
[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>
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/proto.c b/epan/proto.c index 022dba9624..d610e08a5f 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -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); |