diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-11-08 01:04:34 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-11-08 01:04:34 -0500 |
commit | a9b0cc704a937015abba6094cdd14b1f2ecbb5e3 (patch) | |
tree | c9be7ed0689f720fff5d05dca48b3c71f3f5e320 /libdimension/dimension/array.h | |
parent | 302450a001fdadf70c8ab304d97de89de7a989c2 (diff) | |
download | dimension-a9b0cc704a937015abba6094cdd14b1f2ecbb5e3.tar.xz |
Optimize DMNSN_ARRAY_FOREACH_REVERSE() a bit.
Diffstat (limited to 'libdimension/dimension/array.h')
-rw-r--r-- | libdimension/dimension/array.h | 6 |
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 */ |