[asterisk-commits] cdr.c: Replace redundant check with an ast assert() (asterisk[15])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Oct 9 19:48:32 CDT 2017
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6708 )
Change subject: cdr.c: Replace redundant check with an ast_assert()
......................................................................
cdr.c: Replace redundant check with an ast_assert()
The only caller of cdr_object_fn_table.process_party_b() explicitly does
the check before calling.
Change-Id: Ib0c53cdf5048227842846e0df9d2c19117c45618
---
M main/cdr.c
1 file changed, 5 insertions(+), 8 deletions(-)
Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/main/cdr.c b/main/cdr.c
index 1817e80..0703f9e 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -1623,11 +1623,9 @@
static void dial_state_process_party_b(struct cdr_object *cdr, struct ast_channel_snapshot *snapshot)
{
ast_assert(snapshot != NULL);
+ ast_assert(cdr->party_b.snapshot
+ && !strcasecmp(cdr->party_b.snapshot->name, snapshot->name));
- if (!cdr->party_b.snapshot
- || strcasecmp(cdr->party_b.snapshot->name, snapshot->name)) {
- return;
- }
cdr_object_swap_snapshot(&cdr->party_b, snapshot);
/* If party B hangs up, finalize this CDR */
@@ -1823,10 +1821,9 @@
static void bridge_state_process_party_b(struct cdr_object *cdr, struct ast_channel_snapshot *snapshot)
{
- if (!cdr->party_b.snapshot
- || strcasecmp(cdr->party_b.snapshot->name, snapshot->name)) {
- return;
- }
+ ast_assert(cdr->party_b.snapshot
+ && !strcasecmp(cdr->party_b.snapshot->name, snapshot->name));
+
cdr_object_swap_snapshot(&cdr->party_b, snapshot);
/* If party B hangs up, finalize this CDR */
--
To view, visit https://gerrit.asterisk.org/6708
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0c53cdf5048227842846e0df9d2c19117c45618
Gerrit-Change-Number: 6708
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20171009/3e568051/attachment-0001.html>
More information about the asterisk-commits
mailing list