[nginx] Improved code readablity in ngx_http_upstream_init_round...

Homutov Vladimir vl at nginx.com
Tue Dec 3 13:21:49 UTC 2013


details:   http://hg.nginx.org/nginx/rev/359f49a84f87
branches:  
changeset: 5454:359f49a84f87
user:      Vladimir Homutov <vl at nginx.com>
date:      Tue Dec 03 17:12:16 2013 +0400
description:
Improved code readablity in ngx_http_upstream_init_round_robin().

Changed initialization order of the peer structure in one of the
cases to be in line with the rest.

No functional changes.

diffstat:

 src/http/ngx_http_upstream_round_robin.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r b7b8e2fa7ebd -r 359f49a84f87 src/http/ngx_http_upstream_round_robin.c
--- a/src/http/ngx_http_upstream_round_robin.c	Tue Dec 03 15:11:24 2013 +0400
+++ b/src/http/ngx_http_upstream_round_robin.c	Tue Dec 03 17:12:16 2013 +0400
@@ -79,12 +79,12 @@ ngx_http_upstream_init_round_robin(ngx_c
                 peers->peer[n].sockaddr = server[i].addrs[j].sockaddr;
                 peers->peer[n].socklen = server[i].addrs[j].socklen;
                 peers->peer[n].name = server[i].addrs[j].name;
+                peers->peer[n].weight = server[i].weight;
+                peers->peer[n].effective_weight = server[i].weight;
+                peers->peer[n].current_weight = 0;
                 peers->peer[n].max_fails = server[i].max_fails;
                 peers->peer[n].fail_timeout = server[i].fail_timeout;
                 peers->peer[n].down = server[i].down;
-                peers->peer[n].weight = server[i].weight;
-                peers->peer[n].effective_weight = server[i].weight;
-                peers->peer[n].current_weight = 0;
                 n++;
             }
         }



More information about the nginx-devel mailing list