Skip to content

Commit a2dcc8b

Browse files
committed
Remove dead rb_darray_swap_remove
1 parent bc849a1 commit a2dcc8b

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

darray.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,6 @@
7373
(*(ptr_to_ary))->meta.size++; \
7474
} while (0)
7575

76-
/* Removes the element at idx and replaces it with the last element.
77-
* ptr_to_ary and idx is evaluated multiple times.
78-
* Warning: not bounds checked.
79-
*
80-
* void rb_darray_swap_remove(rb_darray(T) *ptr_to_ary, size_t idx);
81-
*/
82-
#define rb_darray_swap_remove(ptr_to_ary, idx) do { \
83-
size_t _darray_size = rb_darray_size(*(ptr_to_ary)); \
84-
if ((idx) != _darray_size - 1) { \
85-
(*(ptr_to_ary))->data[idx] = (*(ptr_to_ary))->data[_darray_size - 1]; \
86-
} \
87-
(*(ptr_to_ary))->meta.size--; \
88-
} while (0)
89-
9076
// Iterate over items of the array in a for loop
9177
//
9278
#define rb_darray_foreach(ary, idx_name, elem_ptr_var) \

0 commit comments

Comments
 (0)