[nginx] svn commit: r5124 - trunk/src/core

ru at nginx.com ru at nginx.com
Thu Mar 21 15:52:53 UTC 2013


Author: ru
Date: 2013-03-21 15:52:52 +0000 (Thu, 21 Mar 2013)
New Revision: 5124
URL: http://trac.nginx.org/nginx/changeset/5124/nginx

Log:
Simplified ngx_array_create().


Modified:
   trunk/src/core/ngx_array.c

Modified: trunk/src/core/ngx_array.c
===================================================================
--- trunk/src/core/ngx_array.c	2013-03-20 18:07:25 UTC (rev 5123)
+++ trunk/src/core/ngx_array.c	2013-03-21 15:52:52 UTC (rev 5124)
@@ -19,16 +19,10 @@
         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;
 }
 



More information about the nginx-devel mailing list