summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-08-30 18:18:13 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2019-08-30 18:18:13 -0400
commit88c3ad84bdd3bda3bb121019d8c55da21bf6fab8 (patch)
treeb86885cd3937d5fa817aa75b30bdb9abc2d27495 /util
parent94e8da0bc35d80df12e2d1490b3aa751576095f6 (diff)
tuple assignment
Diffstat (limited to 'util')
-rw-r--r--util/arr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/arr.c b/util/arr.c
index b3e0558..0d7ddfa 100644
--- a/util/arr.c
+++ b/util/arr.c
@@ -52,3 +52,4 @@ static void arr_free(Array *arr) {
}
#define arr_foreach(arr, type, var) for (type *var = (arr)->data, *var##_foreach_last = arr_last(arr); var; var == var##_foreach_last ? var = NULL : var++)
+#define arr_foreach_reverse(arr, type, var) for (type *var = arr_last(arr); var; var == (arr)->data ? var = NULL : var--)