From: Michael Poole Date: Wed, 18 Mar 2009 03:31:58 +0000 (+0000) Subject: Optimize order of checks in if() to minimize calls to match_it(). X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=5cb589f0d191e85b9bb5d8ec275b6a0db81096ed Optimize order of checks in if() to minimize calls to match_it(). git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1909 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 34d1c0d..dafc314 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-17 Michael Poole + + * ircd/send.c (sendcmdto_match_butone): Move match_it() to the end + of the if() to minimize the number of expensive function calls. + 2009-03-17 Michael Poole * patches/diffs/antispambot.diff: Forward port a patch by Dianora diff --git a/ircd/send.c b/ircd/send.c index b443e30..1afbaec 100644 --- a/ircd/send.c +++ b/ircd/send.c @@ -761,9 +761,9 @@ void sendcmdto_match_butone(struct Client *from, const char *cmd, /* send buffer along */ bump_sentalong(one); for (cptr = GlobalClientList; cptr; cptr = cli_next(cptr)) { - if (!IsRegistered(cptr) || IsServer(cptr) || - !match_it(from, cptr, to, who) || cli_fd(cli_from(cptr)) < 0 || - cli_sentalong(cptr) == sentalong_marker) + if (!IsRegistered(cptr) || IsServer(cptr) || cli_fd(cli_from(cptr)) < 0 || + cli_sentalong(cptr) == sentalong_marker || + !match_it(from, cptr, to, who)) continue; /* skip it */ cli_sentalong(cptr) = sentalong_marker;