From e7096887ed8d8ea9abe5402830447890949f9ea0 Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Wed, 8 Jan 2025 00:00:00 +0000 Subject: [PATCH] style(*): remove redundant nullptr checks on object deletion (#1288) Signed-off-by: k4yt3x --- src/filter_realcugan.cpp | 5 +---- src/filter_realesrgan.cpp | 5 +---- src/interpolator_rife.cpp | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/filter_realcugan.cpp b/src/filter_realcugan.cpp index 95be9d0..37efd7e 100644 --- a/src/filter_realcugan.cpp +++ b/src/filter_realcugan.cpp @@ -32,10 +32,7 @@ FilterRealcugan::FilterRealcugan( model_name_(std::move(model_name)) {} FilterRealcugan::~FilterRealcugan() { - if (realcugan_) { - delete realcugan_; - realcugan_ = nullptr; - } + delete realcugan_; } int FilterRealcugan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) { diff --git a/src/filter_realesrgan.cpp b/src/filter_realesrgan.cpp index 0101b2e..9b5ce7f 100644 --- a/src/filter_realesrgan.cpp +++ b/src/filter_realesrgan.cpp @@ -26,10 +26,7 @@ FilterRealesrgan::FilterRealesrgan( model_name_(std::move(model_name)) {} FilterRealesrgan::~FilterRealesrgan() { - if (realesrgan_) { - delete realesrgan_; - realesrgan_ = nullptr; - } + delete realesrgan_; } int FilterRealesrgan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) { diff --git a/src/interpolator_rife.cpp b/src/interpolator_rife.cpp index 34b1708..08ac3c4 100644 --- a/src/interpolator_rife.cpp +++ b/src/interpolator_rife.cpp @@ -29,10 +29,7 @@ InterpolatorRIFE::InterpolatorRIFE( model_name_(std::move(model_name)) {} InterpolatorRIFE::~InterpolatorRIFE() { - if (rife_) { - delete rife_; - rife_ = nullptr; - } + delete rife_; } int InterpolatorRIFE::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {