]> granicus.if.org Git - apache/commitdiff
move a loop-invariant computation out of the thread loop and
authorJeff Trawick <trawick@apache.org>
Tue, 9 Apr 2002 11:18:41 +0000 (11:18 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 9 Apr 2002 11:18:41 +0000 (11:18 +0000)
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

modules/generators/mod_status.c

index 93635a7bd519374b2885053ed4c9cfb97d3c38cb..bb5637e772a3dbdcb5b263d15493136bc39f6cf8 100644 (file)
@@ -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];