From d36469c359b9ae4b4d7c77ca5321dfa64233385f Mon Sep 17 00:00:00 2001 From: Yash sharma Date: Mon, 15 Jun 2026 21:39:45 +0530 Subject: [PATCH] Removed unnecessary null pointer checks Signed-off-by: Yash sharma --- cactus-graph/src/core.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cactus-graph/src/core.cpp b/cactus-graph/src/core.cpp index 1ad864bb9..b2b2d64ff 100644 --- a/cactus-graph/src/core.cpp +++ b/cactus-graph/src/core.cpp @@ -69,10 +69,9 @@ BufferDesc::BufferDesc(const std::vector& s, Precision prec) } BufferDesc::~BufferDesc() { - if (pooled_data) { delete[] pooled_data; - pooled_data = nullptr; - } + + } BufferDesc::BufferDesc(BufferDesc&& other) noexcept @@ -118,9 +117,7 @@ BufferDesc::BufferDesc(BufferDesc&& other) noexcept BufferDesc& BufferDesc::operator=(BufferDesc&& other) noexcept { if (this != &other) { - if (pooled_data) { - delete[] pooled_data; - } + delete[] pooled_data; shape = std::move(other.shape); total_size = other.total_size;