From d9a8b17a6f490f44750b2d3056f91f3532ee6a69 Mon Sep 17 00:00:00 2001 From: casey langen Date: Mon, 31 Jul 2017 20:06:05 -0700 Subject: [PATCH] Fixed #111 -- removed unnecessary null checks. --- src/core/library/LocalLibrary.cpp | 6 ++---- src/plugins/flacdecoder/FlacDecoder.cpp | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/core/library/LocalLibrary.cpp b/src/core/library/LocalLibrary.cpp index e71d7474c..33b08bf31 100644 --- a/src/core/library/LocalLibrary.cpp +++ b/src/core/library/LocalLibrary.cpp @@ -116,10 +116,8 @@ void LocalLibrary::Close() { { std::unique_lock lock(this->mutex); - if (this->indexer) { - delete this->indexer; - this->indexer = nullptr; - } + delete this->indexer; + this->indexer = nullptr; if (this->thread) { thread = this->thread; diff --git a/src/plugins/flacdecoder/FlacDecoder.cpp b/src/plugins/flacdecoder/FlacDecoder.cpp index 119a7c54d..ffd6abeb2 100644 --- a/src/plugins/flacdecoder/FlacDecoder.cpp +++ b/src/plugins/flacdecoder/FlacDecoder.cpp @@ -52,15 +52,11 @@ FlacDecoder::FlacDecoder() } FlacDecoder::~FlacDecoder() { - if (this->decoder) { - FLAC__stream_decoder_delete(this->decoder); - this->decoder = NULL; - } + FLAC__stream_decoder_delete(this->decoder); + this->decoder = NULL; - if (this->outputBuffer) { - delete this->outputBuffer; - this->outputBuffer = NULL; - } + delete this->outputBuffer; + this->outputBuffer = NULL; } FLAC__StreamDecoderReadStatus FlacDecoder::FlacRead(