There is no need to look in the iaxs array for the pvt struct when we already

have a pointer to it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-02-26 00:37:03 +00:00
parent b0f60e7496
commit 5873c9c90f

View File

@@ -1169,7 +1169,7 @@ static struct iax_frame *iaxfrdup2(struct iax_frame *fr)
#define NEW_ALLOW 1
#define NEW_FORCE 2
static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, struct chan_iax2_pvt *cur)
static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur)
{
if ((cur->addr.sin_addr.s_addr == sin->sin_addr.s_addr) &&
(cur->addr.sin_port == sin->sin_port)) {
@@ -1298,7 +1298,7 @@ static int find_callno(unsigned short callno, unsigned short dcallno, struct soc
AST_RWLIST_RDLOCK(&pvt_hash_tbl[hash]);
AST_RWLIST_TRAVERSE(&pvt_hash_tbl[hash], pvt, entry) {
ast_mutex_lock(&iaxsl[pvt->callno]);
if (match(sin, callno, dcallno, iaxs[pvt->callno]))
if (match(sin, callno, dcallno, pvt))
res = pvt->callno;
ast_mutex_unlock(&iaxsl[pvt->callno]);
if (res > 0)