summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/array.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-06-30 15:53:41 +0000
committerTavian Barnes <tavianator@gmail.com>2009-06-30 15:53:41 +0000
commit5dcc62e9f198094e3fd49be1847871853c1449bc (patch)
treeb8efb924424c0160e77782ce40e8ddb6c85c9e2f /libdimension/dimension/array.h
parenta50808b77e7b7f9c5239d6416bb8cb9741794670 (diff)
downloaddimension-5dcc62e9f198094e3fd49be1847871853c1449bc.tar.xz
New inline function framework.
Diffstat (limited to 'libdimension/dimension/array.h')
-rw-r--r--libdimension/dimension/array.h10
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 */