From b3040da54c4a546930b02057af05b011e646514c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 26 Apr 2021 20:47:22 -0700 Subject: [PATCH] clang-tidy: don't check for NULL with delete Found with readability-delete-null-pointer Signed-off-by: Rosen Penev --- samples/iotest.cpp | 2 +- src/basicio.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/iotest.cpp b/samples/iotest.cpp index 402a620a..bf50b3da 100644 --- a/samples/iotest.cpp +++ b/samples/iotest.cpp @@ -90,7 +90,7 @@ int main(int argc, char* const argv[]) output.putb(io->getb()) ; } } - if ( bytes ) delete [] bytes; + delete[] bytes; output.close(); } diff --git a/src/basicio.cpp b/src/basicio.cpp index b448480e..7447cef7 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -1682,7 +1682,7 @@ namespace Exiv2 { } RemoteIo::Impl::~Impl() { - if (blocksMap_) delete[] blocksMap_; + delete[] blocksMap_; } RemoteIo::~RemoteIo()