Kaydet (Commit) 1412229c authored tarafından Caolán McNamara's avatar Caolán McNamara

cppcheck: redundantCopy

just zero the un-overwritten new entries

Change-Id: Ifea1560a1c46ac5b10c04e6499c02e29a957191a
üst 4f0a68eb
......@@ -559,9 +559,9 @@ void IcnGridMap_Impl::Expand()
size_t nNewCellCount = static_cast<size_t>(nNewGridRows) * nNewGridCols;
bool* pNewGridMap = new bool[nNewCellCount];
memset(pNewGridMap, 0, nNewCellCount * sizeof(bool));
size_t nOldCellCount = static_cast<size_t>(_nGridRows) * _nGridCols;
memcpy(pNewGridMap, _pGridMap, nOldCellCount * sizeof(bool));
memset(pNewGridMap + nOldCellCount, 0, (nNewCellCount-nOldCellCount) * sizeof(bool));
delete[] _pGridMap;
_pGridMap = pNewGridMap;
_nGridRows = nNewGridRows;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment