[nginx] Simplified ngx_list_create().

Ruslan Ermilov ru at nginx.com
Wed Jun 19 04:57:51 UTC 2013


details:   http://hg.nginx.org/nginx/rev/a82f305487c2
branches:  
changeset: 5253:a82f305487c2
user:      Ruslan Ermilov <ru at nginx.com>
date:      Wed Jun 19 08:55:08 2013 +0400
description:
Simplified ngx_list_create().

diffstat:

 src/core/ngx_list.c |  10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diffs (23 lines):

diff -r 982678c5c270 -r a82f305487c2 src/core/ngx_list.c
--- a/src/core/ngx_list.c	Wed Jun 12 00:41:24 2013 +0900
+++ b/src/core/ngx_list.c	Wed Jun 19 08:55:08 2013 +0400
@@ -19,18 +19,10 @@ ngx_list_create(ngx_pool_t *pool, ngx_ui
         return NULL;
     }
 
-    list->part.elts = ngx_palloc(pool, n * size);
-    if (list->part.elts == NULL) {
+    if (ngx_list_init(list, pool, n, size) != NGX_OK) {
         return NULL;
     }
 
-    list->part.nelts = 0;
-    list->part.next = NULL;
-    list->last = &list->part;
-    list->size = size;
-    list->nalloc = n;
-    list->pool = pool;
-
     return list;
 }
 



More information about the nginx-devel mailing list