mirror of
https://github.com/nginx/nginx.git
synced 2026-06-27 04:12:05 +00:00
Simplified ngx_array_create().
This commit is contained in:
parent
9e5f617d66
commit
7b80e43389
1 changed files with 1 additions and 7 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue