mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-23 16:02:38 +00:00
Allow for both odin command path -flags and odin command -flags path
To do this, if the first argument after the command and last argument is NOT a flag, then put that last parameter first.
This commit is contained in:
@@ -449,6 +449,20 @@ gb_internal void array_unordered_remove(Array<T> *array, isize index) {
|
||||
array_pop(array);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
gb_internal void array_inject_at(Array<T> *array, isize index, T value) {
|
||||
GB_ASSERT(0 <= index);
|
||||
|
||||
isize n = gb_max(array->count, index);
|
||||
isize new_size = n+1;
|
||||
array_resize(array, new_size);
|
||||
|
||||
gb_memmove(array->data+index+1, array->data+index, gb_size_of(T)*(array->count-index-1));
|
||||
array->data[index] = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user