changeset 5253:a82f305487c2

Simplified ngx_list_create().
author Ruslan Ermilov <ru@nginx.com>
date Wed, 19 Jun 2013 08:55:08 +0400
parents 982678c5c270
children 7ecaa9e4bf1b
files src/core/ngx_list.c
diffstat 1 files changed, 1 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_list.c
+++ b/src/core/ngx_list.c
@@ -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;
 }