diff options
Diffstat (limited to 'libdimension/dimension/array.h')
-rw-r--r-- | libdimension/dimension/array.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libdimension/dimension/array.h b/libdimension/dimension/array.h index 5d5e50e..036d6c8 100644 --- a/libdimension/dimension/array.h +++ b/libdimension/dimension/array.h @@ -45,7 +45,13 @@ void dmnsn_array_get(const dmnsn_array *array, size_t i, void *obj); void dmnsn_array_set(dmnsn_array *array, size_t i, const void *obj); void *dmnsn_array_at(dmnsn_array *array, size_t i); -size_t dmnsn_array_size(const dmnsn_array *array); -void dmnsn_array_resize(dmnsn_array *array, size_t length); +/* Inline so for-loops calling this are fast */ +DMNSN_INLINE size_t +dmnsn_array_size(const dmnsn_array *array) +{ + return array->length; +} + +void dmnsn_array_resize(dmnsn_array *array, size_t length); #endif /* DIMENSION_ARRAY_H */ |