[njs] Allowing to reserve 0 bytes in njs_chb_reserve() for consistency.

Dmitry Volyntsev xeioex at nginx.com
Mon Jan 11 19:54:02 UTC 2021


details:   https://hg.nginx.org/njs/rev/dbc81c9d4e46
branches:  
changeset: 1590:dbc81c9d4e46
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon Jan 11 19:53:09 2021 +0000
description:
Allowing to reserve 0 bytes in njs_chb_reserve() for consistency.

diffstat:

 src/njs_chb.c |  4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diffs (14 lines):

diff -r 6d285a23fcbb -r dbc81c9d4e46 src/njs_chb.c
--- a/src/njs_chb.c	Mon Jan 11 19:53:08 2021 +0000
+++ b/src/njs_chb.c	Mon Jan 11 19:53:09 2021 +0000
@@ -34,10 +34,6 @@ njs_chb_reserve(njs_chb_t *chain, size_t
 {
     njs_chb_node_t  *n;
 
-    if (njs_slow_path(size == 0)) {
-        return NULL;
-    }
-
     n = chain->last;
 
     if (njs_fast_path(n != NULL && njs_chb_node_room(n) >= size)) {


More information about the nginx-devel mailing list