diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-10-29 14:09:20 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-10-29 14:09:20 +0000 |
commit | 0ad98563a24b8685545825aac889ef43bfc58809 (patch) | |
tree | d44e5d34582bc2a05ba6be6bd8d818e9a813147f /epan/dissectors/packet-ppp.c | |
parent | 86c145ecb33495023a7966030faab5a69a3067eb (diff) |
From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
+ before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344
svn path=/trunk/; revision=52948
Diffstat (limited to 'epan/dissectors/packet-ppp.c')
-rw-r--r-- | epan/dissectors/packet-ppp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c index d1a9b6c215..4ca257f34e 100644 --- a/epan/dissectors/packet-ppp.c +++ b/epan/dissectors/packet-ppp.c @@ -3801,7 +3801,7 @@ dissect_cp(tvbuff_t *tvb, int proto_id, int proto_subtree_index, col_set_str(pinfo->cinfo, COL_PROTOCOL, proto_get_protocol_short_name(find_protocol_by_id(proto_id))); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, proto_vals, "Unknown")); if (tree) { @@ -4054,7 +4054,7 @@ dissect_vsncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) length = tvb_get_ntohs(tvb, 2); col_set_str(pinfo->cinfo, COL_PROTOCOL, "VSNCP"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, cp_vals, "Unknown")); if (tree) { @@ -4316,7 +4316,7 @@ dissect_bap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) length = tvb_get_ntohs(tvb, 2); col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP BAP"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(type, bap_vals, "Unknown")); if (tree) { @@ -5215,7 +5215,7 @@ dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) code = tvb_get_guint8(tvb, 0); col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP PAP"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, pap_vals, "Unknown")); ti = proto_tree_add_item(tree, proto_pap, tvb, 0, -1, ENC_NA); @@ -5301,7 +5301,7 @@ dissect_chap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) code = tvb_get_guint8(tvb, 0); col_set_str(pinfo->cinfo, COL_PROTOCOL, "PPP CHAP"); - col_add_str(pinfo->cinfo, COL_INFO, + col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(code, chap_vals, "Unknown")); if (tree) { |