diff options
author | Anders Broman <anders.broman@ericsson.com> | 2007-11-09 06:01:18 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2007-11-09 06:01:18 +0000 |
commit | 622603589393ddd44656437f2e323c7fecf1c362 (patch) | |
tree | 874c9902e9d5e87aeda6b3c11e76dd35b41312f0 /epan/dissectors/packet-yhoo.c | |
parent | 29cf34d1c2fa3d56559fd08cfa4bc5616f9cbf14 (diff) |
Apply yet another set of the optimization patches:
When offset parameter is 0 replace tvb_bytes_exist() with the faster tvb_length().
On the other hand
if (tvb_bytes_exist(tvb, 0, 20)
is more readable than
if (tvb_length(tvb) >= 20
so only do it in heuristic function
svn path=/trunk/; revision=23412
Diffstat (limited to 'epan/dissectors/packet-yhoo.c')
-rw-r--r-- | epan/dissectors/packet-yhoo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-yhoo.c b/epan/dissectors/packet-yhoo.c index f747e89f57..16ab6bbfdb 100644 --- a/epan/dissectors/packet-yhoo.c +++ b/epan/dissectors/packet-yhoo.c @@ -185,7 +185,7 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } /* get at least a full packet structure */ - if ( !tvb_bytes_exist(tvb, 0, sizeof(struct yahoo_rawpacket)) ) { + if ( tvb_length(tvb) < sizeof(struct yahoo_rawpacket) ) { /* Not enough data captured; maybe it is a Yahoo Messenger packet, but it contains too little data to tell. */ |