VecRemoveFast
- Macro
- October 8, 2025
Table of Contents
VecRemoveFast
VecRemoveFast
Description
Remove item from vector at given index and store in given pointer. Order of elements inside vector is not guaranteed to be preserved. The implementation is faster in some scenarios that VecRemove
Parameters
Name | Direction | Description |
---|---|---|
v | in,out | Vector to remove item from. |
ptr | out | Where removed item will be stored. If not provided then it’s equivalent to deleting the item at specified index. |
idx | in | Index in vector to remove item from. |
Success
return
Failure
Does not return
Usage example (Cross-references)
- In
Remove.h:152
:
/// FAILURE : Does not return
///
#define VecDeleteFast(v, idx) VecRemoveFast((v), (VEC_DATATYPE(v) *)NULL, (idx))
///
- In
VecInt.c:218
:
if (idx < VecLen(vec)) {
i32 removed;
VecRemoveFast(vec, &removed, idx);
}
break;
- In
VecStr.c:244
:
size_t index = extract_u32(data, offset, size) % VecLen(vec);
Str str;
VecRemoveFast(vec, &str, index);
// StrDeinit is called automatically by the vector
}
- In
VecCharPtr.c:254
:
size_t index = extract_u32(data, offset, size) % VecLen(vec);
char *str;
VecRemoveFast(vec, &str, index);
// char_ptr_deinit is called automatically by the vector
}