First check if channel has mode "N", then check membership

This should be more efficient.
This commit is contained in:
Alexander Barton 2015-08-01 14:21:32 +02:00
parent 90ea23ab4f
commit b8482fd3cf
1 changed files with 2 additions and 2 deletions

View File

@ -266,8 +266,8 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
!Client_HasMode(Client, 'o')) {
chan = Channel_First();
while (chan) {
if(Channel_IsMemberOf(chan, Client) &&
Channel_HasMode(chan, 'N'))
if(Channel_HasMode(chan, 'N') &&
Channel_IsMemberOf(chan, Client))
return IRC_WriteErrClient(Client,
ERR_NONICKCHANGE_MSG,
Client_ID(Client),