Skip to content
Snippets Groups Projects
Commit 48bbf808 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

clang-tidy: fix `readability-delete-null-pointer` lints

parent aa3f2de3
No related branches found
No related tags found
No related merge requests found
......@@ -641,17 +641,11 @@ void vtkStaticCellLinksTemplate<TIds>::DeepCopy(vtkAbstractCellLinks* src)
this->NumPts = links->NumPts;
this->NumCells = links->NumCells;
if (this->Links != nullptr)
{
delete[] this->Links;
}
delete[] this->Links;
this->Links = new TIds[this->LinksSize + 1];
std::copy(links->Links, links->Links + (this->LinksSize + 1), this->Links);
if (this->Offsets != nullptr)
{
delete[] this->Offsets;
}
delete[] this->Offsets;
this->Offsets = new TIds[this->NumPts + 1];
std::copy(links->Offsets, links->Offsets + (this->NumPts + 1), this->Offsets);
}
......
......@@ -130,8 +130,7 @@ private:
{
if (size_buf < (size_t)size)
{
if (buf)
delete[] buf;
delete[] buf;
size_buf = size;
buf = new char[size_buf];
}
......@@ -175,8 +174,7 @@ private:
{
if (size_buf <= len)
{
if (buf)
delete[] buf;
delete[] buf;
size_buf = len + 1;
buf = new char[size_buf];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment