From 012df4bc38777c9053353ec2c4213bba67d63ab4 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Sun, 10 Nov 2024 15:14:54 -0600 Subject: Buffered file IO. --- include/fud_vector.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/fud_vector.hpp') diff --git a/include/fud_vector.hpp b/include/fud_vector.hpp index a2a0984..9159770 100644 --- a/include/fud_vector.hpp +++ b/include/fud_vector.hpp @@ -120,7 +120,7 @@ class Vector { static Result, FudStatus> withSize(size_t count, Allocator* allocator = &globalFudAllocator) { Vector output{}; - auto status = initializeWithCapacity(output, count, allocator); + auto status = initializeWithSize(output, count, allocator); if (status != FudStatus::Success) { return FudError{status}; } @@ -402,7 +402,10 @@ class Vector { FudStatus clear() { if (m_allocator == nullptr || m_data == nullptr) { - return FudStatus::ObjectInvalid; + if (m_length > 0) { + return FudStatus::ObjectInvalid; + } + return FudStatus::Success; } for (size_t index = 0; index < m_length; ++index) { m_data[index].~T(); -- cgit v1.2.3