remove memcpy on simple_temporary_data.h

This commit is contained in:
alemuntoni 2021-10-19 15:46:14 +02:00
parent 9353836106
commit 9dccb764ed
1 changed files with 16 additions and 12 deletions

View File

@ -70,9 +70,13 @@ public:
{
if (sz <= datareserve)
return;
bool *newdataLoc = new bool[sz];
if (datasize != 0)
memcpy(newdataLoc, booldata, sizeof(bool) * sizeof(datasize));
bool* newdataLoc = new bool[sz];
if (datasize != 0) {
// memcpy(newdataLoc, booldata, sizeof(bool) * sizeof(datasize));
for (unsigned int i = 0; i < datasize; ++i)
newdataLoc[i] = booldata[i];
}
std::swap(booldata, newdataLoc);
if (newdataLoc != 0)
delete[] newdataLoc;