summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/array.h
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/dimension/array.h')
-rw-r--r--libdimension/dimension/array.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdimension/dimension/array.h b/libdimension/dimension/array.h
index fa48ac0..87af84a 100644
--- a/libdimension/dimension/array.h
+++ b/libdimension/dimension/array.h
@@ -177,9 +177,9 @@ dmnsn_array_remove(dmnsn_array *array, size_t i)
i - (type)dmnsn_array_first(array) < dmnsn_array_size(array); \
++i)
-#define DMNSN_ARRAY_FOREACH_REVERSE(type, i, array) \
- for (type i = dmnsn_array_last(array); \
- (type)dmnsn_array_last(array) - i < dmnsn_array_size(array); \
+#define DMNSN_ARRAY_FOREACH_REVERSE(type, i, array) \
+ for (type i = dmnsn_array_last(array); \
+ i - (type)dmnsn_array_first(array) >= 0; \
--i)
#endif /* DIMENSION_ARRAY_H */