[common] vector: implement a clear operation

This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-08-24 22:10:36 +10:00
1 parent b71838a530
commit 07d3d6cbe7
2 files changed
+6

No files matched your search

+5
View File
@@ -101,3 +101,8 @@ void * vector_ptrTo(Vector * vector, size_t index)
DEBUG_ASSERT(index < vector->size && "Out of bounds access");
return (char *)vector->data + index * vector->itemSize;
}
void vector_clear(Vector * vector)
{
vector->size = 0;
}