From 5cb589f0d191e85b9bb5d8ec275b6a0db81096ed Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Wed, 18 Mar 2009 03:31:58 +0000 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ ircd/send.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) 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; -- 2.20.1