[PATCH] Core: slight optimization in ngx_chain_update_chains()

胡聪 (hucc) hucong.c at foxmail.com
Fri Nov 11 02:38:55 UTC 2016


Hello!


On Fri, Nov 11, 2016 at 0:55 AM, Maxim Dounin wrote:

>Looking into this again I tend to think that better solution would 
>be to test *out in additional if around all operations with *out, 
>like this (diff -w for clarity):
>
>@@ -186,6 +186,7 @@ ngx_chain_update_chains(ngx_pool_t *p, n
> {
>     ngx_chain_t  *cl;
> 
>+    if (*out) {
>     if (*busy == NULL) {
>         *busy = *out;
> 
>@@ -196,6 +197,7 @@ ngx_chain_update_chains(ngx_pool_t *p, n
>     }
> 
>     *out = NULL;
>+    }
> 
>     while (*busy) {
>         cl = *busy;

Yes, it`s truly better!


Regards,
-hucc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20161111/a7a3b25d/attachment.html>


More information about the nginx-devel mailing list