mirror of
https://github.com/nginx/nginx.git
synced 2024-12-20 06:03:31 -06:00
Simplified ngx_array_create().
This commit is contained in:
parent
9e5f617d66
commit
7b80e43389
@ -19,16 +19,10 @@ ngx_array_create(ngx_pool_t *p, ngx_uint_t n, size_t size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
a->elts = ngx_palloc(p, n * size);
|
||||
if (a->elts == NULL) {
|
||||
if (ngx_array_init(a, p, n, size) != NGX_OK) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
a->nelts = 0;
|
||||
a->size = size;
|
||||
a->nalloc = n;
|
||||
a->pool = p;
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user