mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 11:36:25 +00:00
common/array: ++safety
do not try memory copy if the size is 0.
This commit is contained in:
parent
dcf6ebcf18
commit
13b46c41d2
1 changed files with 1 additions and 0 deletions
|
@ -61,6 +61,7 @@ struct Array
|
|||
|
||||
void push(Array<T>& rhs)
|
||||
{
|
||||
if (rhs.count == 0) return;
|
||||
grow(rhs.count);
|
||||
memcpy(data + count, rhs.data, rhs.count * sizeof(T));
|
||||
count += rhs.count;
|
||||
|
|
Loading…
Add table
Reference in a new issue