Optimize order of checks in if() to minimize calls to match_it().
authorMichael Poole <mdpoole@troilus.org>
Wed, 18 Mar 2009 03:31:58 +0000 (03:31 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 18 Mar 2009 03:31:58 +0000 (03:31 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1909 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/send.c

index 34d1c0daaa896fcd10e5ce6ac33e3e3fa2bde5f4..dafc314c96da8c12f3f2f6742a829cebda58b7aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-17  Michael Poole <mdpoole@troilus.org>
+
+       * 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 <mdpoole@troilus.org>
 
        * patches/diffs/antispambot.diff: Forward port a patch by Dianora
index b443e30908432d5ffe410471af420f132bcd0b2d..1afbaec34ccf12c7a2ebfb791c8aa704f9994729 100644 (file)
@@ -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;