[PATCH] Gzip: avoid unnecessary assignment

Piotr Sikora piotr at cloudflare.com
Sat Aug 2 03:40:12 UTC 2014


# HG changeset patch
# User Piotr Sikora <piotr at cloudflare.com>
# Date 1406950763 25200
#      Fri Aug 01 20:39:23 2014 -0700
# Node ID 78c35623c5fa444e8ce7a3af5999477a117f79be
# Parent  f87afb46ccd26fccc7ed55ca8a7ef89c6256c3f2
Gzip: avoid unnecessary assignment.

This change makes it consistent with other custom memory allocators
provided for zlib.

Signed-off-by: Piotr Sikora <piotr at cloudflare.com>

diff -r f87afb46ccd2 -r 78c35623c5fa src/http/modules/ngx_http_gzip_filter_module.c
--- a/src/http/modules/ngx_http_gzip_filter_module.c	Fri Aug 01 20:04:14 2014 +0900
+++ b/src/http/modules/ngx_http_gzip_filter_module.c	Fri Aug 01 20:39:23 2014 -0700
@@ -1013,9 +1013,7 @@ ngx_http_gzip_filter_alloc(void *opaque,
                   "gzip filter failed to use preallocated memory: %ud of %ud",
                   items * size, ctx->allocated);
 
-    p = ngx_palloc(ctx->request->pool, items * size);
-
-    return p;
+    return ngx_palloc(ctx->request->pool, items * size);
 }
 
 



More information about the nginx-devel mailing list