From: Volker Lendecke Date: Sun, 15 Nov 2009 21:22:38 +0000 (+0100) Subject: s3: Tune if-conditions in a very hot codepath X-Git-Tag: samba-4.0.0alpha9~286 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a1606269aeeeb1b777974d88c33df543d1b6f4d;p=thirdparty%2Fsamba.git s3: Tune if-conditions in a very hot codepath This looks innocent, but it is visible in a netbench run. Due to boolean short-circuiting we don't have to execute the conditions on the right-hand side of the &&. So putting the less likely condition left gains a bit. --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ae88db7562f..682f56ff33e 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -67,7 +67,7 @@ static NTSTATUS check_path_syntax_internal(char *path, } } - if (!posix_path && !stream_started && *s == ':') { + if ((*s == ':') && !posix_path && !stream_started) { if (*p_last_component_contains_wcard) { return NT_STATUS_OBJECT_NAME_INVALID; }