eina_array: interpret the count of a NULL array as 0

this makes the usage way more convinient.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D11373
This commit is contained in:
Marcel Hollerbach 2020-02-17 13:55:33 +01:00
parent 9442598768
commit 6c251b2d01
1 changed files with 1 additions and 0 deletions

View File

@ -89,6 +89,7 @@ eina_array_count_get(const Eina_Array *array)
static inline unsigned int
eina_array_count(const Eina_Array *array)
{
if (!array) return 0;
return array->count;
}