]> git.kaiwu.me - nginx.git/commitdiff
Cache: reduced diffs to the plus version of nginx.
authorRuslan Ermilov <ru@nginx.com>
Tue, 17 Feb 2015 13:27:52 +0000 (16:27 +0300)
committerRuslan Ermilov <ru@nginx.com>
Tue, 17 Feb 2015 13:27:52 +0000 (16:27 +0300)
No functional changes.

src/http/ngx_http_file_cache.c

index 00d4c0f5a9fcd7af53318ff74ba95418c0bbb99f..8d06fb9bfd6e7bccbe6b82f94fe4927c7bbdb429 100644 (file)
@@ -258,7 +258,7 @@ ngx_int_t
 ngx_http_file_cache_open(ngx_http_request_t *r)
 {
     ngx_int_t                  rc, rv;
-    ngx_uint_t                 cold, test;
+    ngx_uint_t                 test;
     ngx_http_cache_t          *c;
     ngx_pool_cleanup_t        *cln;
     ngx_open_file_info_t       of;
@@ -300,8 +300,6 @@ ngx_http_file_cache_open(ngx_http_request_t *r)
         return NGX_HTTP_CACHE_SCARCE;
     }
 
-    cold = cache->sh->cold;
-
     if (rc == NGX_OK) {
 
         if (c->error) {
@@ -314,18 +312,18 @@ ngx_http_file_cache_open(ngx_http_request_t *r)
 
     } else { /* rc == NGX_DECLINED */
 
+        test = cache->sh->cold ? 1 : 0;
+
         if (c->min_uses > 1) {
 
-            if (!cold) {
+            if (!test) {
                 return NGX_HTTP_CACHE_SCARCE;
             }
 
-            test = 1;
             rv = NGX_HTTP_CACHE_SCARCE;
 
         } else {
             c->temp_file = 1;
-            test = cold ? 1 : 0;
             rv = NGX_DECLINED;
         }
     }