[asterisk-commits] russell: branch 1.4 r114673 - /branches/1.4/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 25 16:54:40 CDT 2008


Author: russell
Date: Fri Apr 25 16:54:40 2008
New Revision: 114673

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114673
Log:
Use consistent logic for checking to see if a call number has been chosen yet.
Also, remove some redundant logic I recently added in a fix.

Modified:
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=114673&r1=114672&r2=114673
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Fri Apr 25 16:54:40 2008
@@ -1345,7 +1345,7 @@
 
 	if (new <= NEW_ALLOW) {
 		/* Look for an existing connection first */
-		for (x=1;(res < 1) && (x<maxnontrunkcall);x++) {
+		for (x = 1; !res && x < maxnontrunkcall; x++) {
 			ast_mutex_lock(&iaxsl[x]);
 			if (iaxs[x]) {
 				/* Look for an exact match */
@@ -1353,10 +1353,10 @@
 					res = x;
 				}
 			}
-			if (!res || (res && !return_locked))
+			if (!res || !return_locked)
 				ast_mutex_unlock(&iaxsl[x]);
 		}
-		for (x=TRUNK_CALL_START;(res < 1) && (x<maxtrunkcall);x++) {
+		for (x = TRUNK_CALL_START; !res && x < maxtrunkcall; x++) {
 			ast_mutex_lock(&iaxsl[x]);
 			if (iaxs[x]) {
 				/* Look for an exact match */
@@ -1364,11 +1364,11 @@
 					res = x;
 				}
 			}
-			if (!res || (res && !return_locked))
+			if (!res || !return_locked)
 				ast_mutex_unlock(&iaxsl[x]);
 		}
 	}
-	if ((res < 1) && (new >= NEW_ALLOW)) {
+	if (!res && (new >= NEW_ALLOW)) {
 		int start, found = 0;
 
 		/* It may seem odd that we look through the peer list for a name for




More information about the asterisk-commits mailing list