aboutsummaryrefslogtreecommitdiff
path: root/builtins/array.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-26 14:02:48 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-03-26 14:02:48 -0400
commit135e23094c42b33acdd05dd522bbe0fd691b9eee (patch)
tree68a675393083286a79d3f66e6f57aa4ac1ebd212 /builtins/array.h
parent59b62035c1304b4c6c39b6d546b9c5187e8d0738 (diff)
Improve codegen for table/array iteration by inlining the iteration
macros
Diffstat (limited to 'builtins/array.h')
-rw-r--r--builtins/array.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/builtins/array.h b/builtins/array.h
index df66e636..b538be30 100644
--- a/builtins/array.h
+++ b/builtins/array.h
@@ -51,13 +51,6 @@
.data_refcount=1}; })
#define $ARRAY_INCREF(arr) (arr).data_refcount |= ((arr).data_refcount << 1) | 1
#define $ARRAY_DECREF(arr) (arr).data_refcount &= 2
-#define $ARRAY_FOREACH(arr_expr, i, item_type, x, body, else_body) {\
- array_t $arr = arr_expr; \
- $ARRAY_INCREF($arr); \
- if ($arr.length == 0) else_body \
- else for (int64_t i = 1; i <= $arr.length; i++) { item_type x = *(item_type*)($arr.data + (i-1)*$arr.stride); body } \
- $ARRAY_DECREF($arr); \
- }
#define Array__insert_value(arr, item_expr, index, type) ({ __typeof(item_expr) $item = item_expr; Array__insert(arr, &$item, index, type); })
void Array__insert(array_t *arr, const void *item, int64_t index, const TypeInfo *type);