grow array only when required, use step properly.

We need to grow when we reach total amount, not when current + step > total.



SVN revision: 37959
This commit is contained in:
Gustavo Sverzut Barbieri 2008-12-06 06:13:55 +00:00
parent 091741f861
commit 08832b519b
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ EAPI Eina_Bool eina_array_grow(Eina_Array *array);
static inline Eina_Bool
eina_array_push(Eina_Array *array, const void *data)
{
if (UNLIKELY((array->count + array->step) > array->total))
if (UNLIKELY((array->count + 1) > array->total))
if (!eina_array_grow(array)) return EINA_FALSE;
array->data[array->count++] = (void*) data;