Files
ground-rewrite/src/List/append.c

18 lines
463 B
C
Raw Normal View History

2026-06-13 19:45:36 +10:00
#include "../../include/ground.h"
void _GroundListAppend(GroundList* list, GroundValue value) {
if (list->count + 1 >= list->capacity) {
GroundValue* tmp = realloc(list->at, sizeof(GroundValue) * list->capacity * 2);
if (tmp == NULL) {
Ground.Flags.error = true;
return;
}
list->at = tmp;
list->capacity *= 2;
}
list->at[list->count] = Ground.Copy.Value(&value);
list->count++;
}