From: Ruslan Ermilov Date: Wed, 19 Jun 2013 04:55:08 +0000 (+0400) Subject: Simplified ngx_list_create(). X-Git-Tag: release-1.5.2~4 X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=02cc52554f7ef326bb92df4ecced524e5d01ee19;p=nginx.git Simplified ngx_list_create(). --- diff --git a/src/core/ngx_list.c b/src/core/ngx_list.c index 89ea82352..d0eb15930 100644 --- a/src/core/ngx_list.c +++ b/src/core/ngx_list.c @@ -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; }