From: Victor J. Orlikowski Date: Tue, 10 Apr 2001 18:03:46 +0000 (+0000) Subject: *Sigh*. Pointless repetition of calculations. It bothers me. Even if X-Git-Tag: 2.0.17~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3dd2c071026193876267fe7b3935dab90a9da00;p=thirdparty%2Fapache%2Fhttpd.git *Sigh*. Pointless repetition of calculations. It bothers me. Even if it is simple bitwise AND. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88790 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/log.c b/server/log.c index 8d17e69a23a..bcbe2e9482a 100644 --- a/server/log.c +++ b/server/log.c @@ -337,6 +337,7 @@ static void log_error_core(const char *file, int line, int level, size_t len; apr_file_t *logf = NULL; const char *referer; + int level_and_mask = level & APLOG_LEVELMASK; if (s == NULL) { /* @@ -344,8 +345,8 @@ static void log_error_core(const char *file, int line, int level, * above the default server log level unless it is a startup/shutdown * notice */ - if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) && - ((level & APLOG_LEVELMASK) > DEFAULT_LOGLEVEL)) + if ((level_and_mask != APLOG_NOTICE) && + (level_and_mask > DEFAULT_LOGLEVEL)) return; logf = stderr_log; } @@ -354,8 +355,8 @@ static void log_error_core(const char *file, int line, int level, * If we are doing normal logging, don't log messages that are * above the server log level unless it is a startup/shutdown notice */ - if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) && - ((level & APLOG_LEVELMASK) > s->loglevel)) + if ((level_and_mask != APLOG_NOTICE) && + (level_and_mask > s->loglevel)) return; logf = s->error_log; } @@ -365,8 +366,8 @@ static void log_error_core(const char *file, int line, int level, * If we are doing normal logging, don't log messages that are * above the server log level unless it is a startup/shutdown notice */ - if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) && - ((level & APLOG_LEVELMASK) > s->loglevel)) + if ((level_and_mask != APLOG_NOTICE) && + (level_and_mask > s->loglevel)) return; logf = stderr; } @@ -376,7 +377,7 @@ static void log_error_core(const char *file, int line, int level, * If we are doing syslog logging, don't log messages that are * above the server log level (including a startup/shutdown notice) */ - if ((level & APLOG_LEVELMASK) > s->loglevel) + if (level_and_mask > s->loglevel) return; logf = NULL; } @@ -396,7 +397,7 @@ static void log_error_core(const char *file, int line, int level, "[%s] ", priorities[level & APLOG_LEVELMASK].t_name); } #ifndef TPF - if (file && (level & APLOG_LEVELMASK) == APLOG_DEBUG) { + if (file && level_and_mask == APLOG_DEBUG) { #ifdef _OSD_POSIX char tmp[256]; char *e = strrchr(file, '/'); @@ -452,7 +453,7 @@ static void log_error_core(const char *file, int line, int level, } #ifdef HAVE_SYSLOG else { - syslog(level & APLOG_LEVELMASK, "%s", errstr); + syslog(level_and_mask, "%s", errstr); } #endif }