]> git.kaiwu.me - nginx.git/commitdiff
Map: simplified "map" block parser.
authorRuslan Ermilov <ru@nginx.com>
Thu, 8 Dec 2016 14:29:01 +0000 (17:29 +0300)
committerRuslan Ermilov <ru@nginx.com>
Thu, 8 Dec 2016 14:29:01 +0000 (17:29 +0300)
No functional changes.

src/http/modules/ngx_http_map_module.c
src/stream/ngx_stream_map_module.c

index 732aa5d7d3c57b70da2925badd9907356668dbc9..32393436b5ff7a1444f970b632a3ff090945679b 100644 (file)
@@ -393,8 +393,9 @@ ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
     {
         ctx->hostnames = 1;
         return NGX_CONF_OK;
+    }
 
-    } else if (cf->args->nelts != 2) {
+    if (cf->args->nelts != 2) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                            "invalid number of the map parameters");
         return NGX_CONF_ERROR;
index 47a15bef7a64c8970bc70fe19af6d720a13db209..e65c70ca04d2d95b7a8615dba532aeaebf768a98 100644 (file)
@@ -392,8 +392,9 @@ ngx_stream_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
     {
         ctx->hostnames = 1;
         return NGX_CONF_OK;
+    }
 
-    } else if (cf->args->nelts != 2) {
+    if (cf->args->nelts != 2) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                            "invalid number of the map parameters");
         return NGX_CONF_ERROR;