mirror of
https://github.com/Mr-X-GTA/GTAV-Classes-1.git
synced 2024-12-22 22:47:32 +08:00
atArray: copy data only if not null (#123)
This commit is contained in:
parent
249d3ad290
commit
5150441a5c
@ -27,6 +27,12 @@ namespace rage
|
|||||||
m_count = right.m_count;
|
m_count = right.m_count;
|
||||||
m_size = right.m_size;
|
m_size = right.m_size;
|
||||||
|
|
||||||
|
if (right.m_data == nullptr)
|
||||||
|
{
|
||||||
|
m_data = nullptr;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_data = (T*)tlsContext::get()->m_allocator->Allocate(m_size * sizeof(T), 16, 0);
|
m_data = (T*)tlsContext::get()->m_allocator->Allocate(m_size * sizeof(T), 16, 0);
|
||||||
std::uninitialized_copy(right.m_data, right.m_data + right.m_count, m_data);
|
std::uninitialized_copy(right.m_data, right.m_data + right.m_count, m_data);
|
||||||
}
|
}
|
||||||
@ -153,12 +159,12 @@ namespace rage
|
|||||||
m_data = newOffset;
|
m_data = newOffset;
|
||||||
m_count = newSize;
|
m_count = newSize;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void append(T value)
|
void append(T value)
|
||||||
{
|
{
|
||||||
set(m_count, value);
|
set(m_count, value);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
T* begin() const
|
T* begin() const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user