[nginx] Style improved after 12dd27b74117.

Maxim Dounin mdounin at mdounin.ru
Wed Aug 21 15:51:51 UTC 2013


details:   http://hg.nginx.org/nginx/rev/e04083b79335
branches:  
changeset: 5331:e04083b79335
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Tue Aug 20 21:33:43 2013 +0400
description:
Style improved after 12dd27b74117.

diffstat:

 src/core/ngx_conf_file.c   |   9 +++++----
 src/http/ngx_http_script.c |  13 +++++--------
 2 files changed, 10 insertions(+), 12 deletions(-)

diffs (48 lines):

diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -800,10 +800,11 @@ ngx_conf_include(ngx_conf_t *cf, ngx_com
 ngx_int_t
 ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name, ngx_uint_t conf_prefix)
 {
-    return ngx_get_full_name(cycle->pool,
-                             conf_prefix ? &cycle->conf_prefix:
-                                           &cycle->prefix,
-                             name);
+    ngx_str_t  *prefix;
+
+    prefix = conf_prefix ? &cycle->conf_prefix : &cycle->prefix;
+
+    return ngx_get_full_name(cycle->pool, prefix, name);
 }
 
 
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -1327,20 +1327,17 @@ ngx_http_script_full_name_code(ngx_http_
 {
     ngx_http_script_full_name_code_t  *code;
 
-    ngx_str_t  value;
+    ngx_str_t  value, *prefix;
 
     code = (ngx_http_script_full_name_code_t *) e->ip;
 
     value.data = e->buf.data;
     value.len = e->pos - e->buf.data;
 
-    if (ngx_get_full_name(e->request->pool,
-                          code->conf_prefix
-                                       ? (ngx_str_t *) &ngx_cycle->conf_prefix:
-                                         (ngx_str_t *) &ngx_cycle->prefix,
-                          &value)
-        != NGX_OK)
-    {
+    prefix = code->conf_prefix ? (ngx_str_t *) &ngx_cycle->conf_prefix:
+                                 (ngx_str_t *) &ngx_cycle->prefix;
+
+    if (ngx_get_full_name(e->request->pool, prefix, &value) != NGX_OK) {
         e->ip = ngx_http_script_exit;
         e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
         return;



More information about the nginx-devel mailing list