clay/generator/array_set.template.c

6 lines
229 B
C
Raw Normal View History

void $NAME$_Set($NAME$ *array, int32_t index, $TYPE$ value) {
if (Clay__Array_RangeCheck(index, array->capacity)) {
2024-08-23 04:05:23 +00:00
array->internalArray[index] = value;
array->length = index < array->length ? array->length : index + 1;
}
}