File tree 1 file changed +0
-20
lines changed
1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change 50
50
(*(ptr_to_ary))->meta.size++; \
51
51
} while (0)
52
52
53
-
54
- // Last element of the array
55
- //
56
- #define rb_darray_back (ary ) ((ary)->data[(ary)->meta.size - 1])
57
-
58
- // Remove the last element of the array.
59
- //
60
- #define rb_darray_pop_back (ary ) ((ary)->meta.size--)
61
-
62
- // Remove element at idx and replace it by the last element
63
- #define rb_darray_remove_unordered (ary , idx ) do { \
64
- rb_darray_set(ary, idx, rb_darray_back(ary)); \
65
- rb_darray_pop_back(ary); \
66
- } while (0);
67
-
68
53
// Iterate over items of the array in a for loop
69
54
//
70
55
#define rb_darray_foreach (ary , idx_name , elem_ptr_var ) \
71
56
for (size_t idx_name = 0; idx_name < rb_darray_size(ary) && ((elem_ptr_var) = rb_darray_ref(ary, idx_name)); ++idx_name)
72
57
73
- // Iterate over valid indices in the array in a for loop
74
- //
75
- #define rb_darray_for (ary , idx_name ) \
76
- for (size_t idx_name = 0; idx_name < rb_darray_size(ary); ++idx_name)
77
-
78
58
// Make a dynamic array of a certain size. All bytes backing the elements are set to zero.
79
59
//
80
60
// Note that NULL is a valid empty dynamic array.
You can’t perform that action at this time.
0 commit comments