summaryrefslogtreecommitdiff
path: root/darray.h
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-07-21 15:44:24 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-07-21 15:44:24 -0400
commit11deab7906bd12d3c706aa162cb082e8bccbd2a8 (patch)
treefa5664f240f8c3d01acc1fbb97c9706d853cda37 /darray.h
parent83605bb6149ec65b670dac4fcd3afa3fb2e67114 (diff)
Remove unused code in darray.h
Diffstat (limited to 'darray.h')
-rw-r--r--darray.h20
1 files changed, 0 insertions, 20 deletions
diff --git a/darray.h b/darray.h
index 7183041f03..db95c8b60e 100644
--- a/darray.h
+++ b/darray.h
@@ -50,31 +50,11 @@
(*(ptr_to_ary))->meta.size++; \
} while (0)
-
-// Last element of the array
-//
-#define rb_darray_back(ary) ((ary)->data[(ary)->meta.size - 1])
-
-// Remove the last element of the array.
-//
-#define rb_darray_pop_back(ary) ((ary)->meta.size--)
-
-// Remove element at idx and replace it by the last element
-#define rb_darray_remove_unordered(ary, idx) do { \
- rb_darray_set(ary, idx, rb_darray_back(ary)); \
- rb_darray_pop_back(ary); \
-} while (0);
-
// Iterate over items of the array in a for loop
//
#define rb_darray_foreach(ary, idx_name, elem_ptr_var) \
for (size_t idx_name = 0; idx_name < rb_darray_size(ary) && ((elem_ptr_var) = rb_darray_ref(ary, idx_name)); ++idx_name)
-// Iterate over valid indices in the array in a for loop
-//
-#define rb_darray_for(ary, idx_name) \
- for (size_t idx_name = 0; idx_name < rb_darray_size(ary); ++idx_name)
-
// Make a dynamic array of a certain size. All bytes backing the elements are set to zero.
//
// Note that NULL is a valid empty dynamic array.