mirror of
https://github.com/nicbarker/clay.git
synced 2025-01-23 18:06:04 +00:00
9 lines
293 B
C
9 lines
293 B
C
$TYPE$ $NAME$_RemoveSwapback($NAME$ *array, int index) {
|
|
if (Clay__Array_RangeCheck(index, array->length)) {
|
|
array->length--;
|
|
$TYPE$ removed = array->internalArray[index];
|
|
array->internalArray[index] = array->internalArray[array->length];
|
|
return removed;
|
|
}
|
|
return $DEFAULT_VALUE$;
|
|
} |