]> git.kaiwu.me - nginx.git/commitdiff
Simplified ngx_list_create().
authorRuslan Ermilov <ru@nginx.com>
Wed, 19 Jun 2013 04:55:08 +0000 (08:55 +0400)
committerRuslan Ermilov <ru@nginx.com>
Wed, 19 Jun 2013 04:55:08 +0000 (08:55 +0400)
src/core/ngx_list.c

index 89ea8235275cec69d9d99258f1ec646462f59850..d0eb15930a86d81cc7bf467f0b8ecb83d551a1e6 100644 (file)
@@ -19,18 +19,10 @@ ngx_list_create(ngx_pool_t *pool, ngx_uint_t n, size_t size)
         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;
 }