From: Jeff Trawick Date: Tue, 9 Apr 2002 11:18:41 +0000 (+0000) Subject: move a loop-invariant computation out of the thread loop and X-Git-Tag: 2.0.36~246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f3d6de7691e0b2d87d8f29f3c6064085c5ea9bd;p=apache move a loop-invariant computation out of the thread loop and at the same time quiet a gcc warning (it assumed that thread_limit could be zero, which would leave ps_record uninitialized when referenced after the end of the thread loop) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94579 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 93635a7bd5..bb5637e772 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -326,11 +326,11 @@ static int status_handler(request_rec *r) return 0; for (i = 0; i < server_limit; ++i) { + ps_record = ap_get_scoreboard_process(i); for (j = 0; j < thread_limit; ++j) { int indx = (i * thread_limit) + j; ws_record = ap_get_scoreboard_worker(i, j); - ps_record = ap_get_scoreboard_process(i); res = ws_record->status; stat_buffer[indx] = status_flags[res];