diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-12-04 10:59:34 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-12-04 10:59:34 +0000 |
commit | 89bde6a8258de710b9032a5e32ffe9346be3c45f (patch) | |
tree | bf784482d59a9572d596b1c1177beb842447717d /proto_hier_stats.c | |
parent | e31b81049ebe70cdeebf55708d67cdbe8de4334e (diff) |
Don't use GNodes for the protocol tree, put the sibling pointer, and
pointers to the first *and* last child, in the "proto_node" structure
itself. That saves us one level of indirection and memory allocation,
and lets us append to a tree by appending to the last child directly,
rather than having to scan through the list of siblings of the first
child to find the end of that list.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9171 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'proto_hier_stats.c')
-rw-r--r-- | proto_hier_stats.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/proto_hier_stats.c b/proto_hier_stats.c index 266c7dd070..641ee0d24c 100644 --- a/proto_hier_stats.c +++ b/proto_hier_stats.c @@ -1,7 +1,7 @@ /* proto_hier_stats.c * Routines for calculating statistics based on protocol. * - * $Id: proto_hier_stats.c,v 1.19 2003/12/03 09:28:19 guy Exp $ + * $Id: proto_hier_stats.c,v 1.20 2003/12/04 10:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -76,11 +76,11 @@ find_stat_node(GNode *parent_stat_node, header_field_info *needle_hfinfo) static void -process_node(proto_item *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, guint pkt_len) +process_node(proto_node *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, guint pkt_len) { field_info *finfo; - ph_stats_node_t *stats; - proto_item *proto_sibling_node; + ph_stats_node_t *stats; + proto_node *proto_sibling_node; GNode *stat_node; finfo = PITEM_FINFO(ptree_node); @@ -95,7 +95,7 @@ process_node(proto_item *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu stats->num_pkts_total++; stats->num_bytes_total += pkt_len; - proto_sibling_node = g_node_next_sibling(ptree_node); + proto_sibling_node = ptree_node->next; if (proto_sibling_node) { process_node(proto_sibling_node, stat_node, ps, pkt_len); @@ -111,9 +111,9 @@ process_node(proto_item *ptree_node, GNode *parent_stat_node, ph_stats_t *ps, gu static void process_tree(proto_tree *protocol_tree, ph_stats_t* ps, guint pkt_len) { - proto_item *ptree_node; + proto_node *ptree_node; - ptree_node = g_node_first_child(protocol_tree); + ptree_node = ((proto_node *)protocol_tree)->first_child; if (!ptree_node) { return; } |