diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2013-10-05 18:38:25 +0000 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2013-10-05 18:38:25 +0000 |
commit | 71a4ec880165242544c66e12f12acbcd203390e1 (patch) | |
tree | 623929b047bbf7493f0af2368c9f85490c78b215 /epan/dissectors/packet-nsip.c | |
parent | a15760bd63942e93c9d8a760e75201fac6faabdc (diff) |
remove some unnecessary if (tree) checks
svn path=/trunk/; revision=52379
Diffstat (limited to 'epan/dissectors/packet-nsip.c')
-rw-r--r-- | epan/dissectors/packet-nsip.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c index f4ec054964..96924ce2f8 100644 --- a/epan/dissectors/packet-nsip.c +++ b/epan/dissectors/packet-nsip.c @@ -337,11 +337,9 @@ static void decode_iei_ns_pdu(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { tvbuff_t * next_tvb; - if (bi->nsip_tree) { - proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, - ie->total_length, - "NS PDU (%u bytes)", ie->value_length); - } + proto_tree_add_text(bi->nsip_tree, bi->tvb, ie_start_offset, + ie->total_length, + "NS PDU (%u bytes)", ie->value_length); next_tvb = tvb_new_subset(bi->tvb, bi->offset, ie->value_length, -1); if (nsip_handle) { gboolean was_recursive; @@ -357,10 +355,8 @@ static void decode_iei_nsei(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint16 nsei = tvb_get_ntohs(bi->tvb, bi->offset); - if (bi->nsip_tree) { - proto_tree_add_uint(bi->nsip_tree, hf_nsip_nsei, bi->tvb, - ie_start_offset, ie->total_length, nsei); - } + proto_tree_add_uint(bi->nsip_tree, hf_nsip_nsei, bi->tvb, + ie_start_offset, ie->total_length, nsei); bi->offset += ie->value_length; col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, @@ -373,10 +369,8 @@ static void decode_iei_bvci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint16 bvci = tvb_get_ntohs(bi->tvb, bi->offset); - if (bi->nsip_tree) { - proto_tree_add_uint(bi->nsip_tree, hf_nsip_bvci, bi->tvb, - ie_start_offset, ie->total_length, bvci); - } + proto_tree_add_uint(bi->nsip_tree, hf_nsip_bvci, bi->tvb, + ie_start_offset, ie->total_length, bvci); bi->offset += ie->value_length; col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, @@ -574,14 +568,12 @@ decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { static void decode_iei_transaction_id(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) { guint8 id; - if (bi->nsip_tree) { - id = tvb_get_guint8(bi->tvb, bi->offset); - proto_tree_add_uint(bi->nsip_tree, hf_nsip_transaction_id, - bi->tvb, ie_start_offset, ie->total_length, id); - col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, - "Transaction Id: %d", id); - } - bi->offset += 1; + id = tvb_get_guint8(bi->tvb, bi->offset); + proto_tree_add_uint(bi->nsip_tree, hf_nsip_transaction_id, + bi->tvb, ie_start_offset, ie->total_length, id); + col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP, + "Transaction Id: %d", id); + bi->offset += 1; } static void |