From df3c553f4f6a78cddbd4f534c5d7f45545c48c53 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Thu, 25 Aug 2022 00:01:56 +0200 Subject: [PATCH] Remove redundant nullptr check. (#6326) --- CHANGELOG.md | 1 + include/util/deallocating_vector.hpp | 6 +----- src/storage/storage.cpp | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da608b1c8..0dd58e3af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - NodeJS: - FIXED: Support `skip_waypoints` in Node bindings [#6060](https://github.com/Project-OSRM/osrm-backend/pull/6060) - Misc: + - CHANGED: Remove redundant nullptr check. [#6326](https://github.com/Project-OSRM/osrm-backend/pull/6326) - CHANGED: missing files list is included in exception message. [#5360](https://github.com/Project-OSRM/osrm-backend/pull/5360) - CHANGED: Do not use deprecated Callback::Call overload in Node bindings. [#6318](https://github.com/Project-OSRM/osrm-backend/pull/6318) - FIXED: Fix distance calculation consistency. [#6315](https://github.com/Project-OSRM/osrm-backend/pull/6315) diff --git a/include/util/deallocating_vector.hpp b/include/util/deallocating_vector.hpp index afc357f6f..484a51b1b 100644 --- a/include/util/deallocating_vector.hpp +++ b/include/util/deallocating_vector.hpp @@ -236,11 +236,7 @@ template class DeallocatingVector // Delete[]'ing ptr's to all Buckets for (auto bucket : bucket_list) { - if (nullptr != bucket) - { - delete[] bucket; - bucket = nullptr; - } + delete[] bucket; } bucket_list.clear(); bucket_list.shrink_to_fit(); diff --git a/src/storage/storage.cpp b/src/storage/storage.cpp index 13ba1b015..4aba706a0 100644 --- a/src/storage/storage.cpp +++ b/src/storage/storage.cpp @@ -312,7 +312,7 @@ std::vector> Storage::GetStaticFiles() { if (file.first == IS_REQUIRED && !boost::filesystem::exists(file.second)) { - throw util::exception("Could not find required filed: " + std::get<1>(file).string()); + throw util::exception("Could not find required file(s): " + std::get<1>(file).string()); } } @@ -337,7 +337,7 @@ std::vector> Storage::GetUpdatableFiles { if (file.first == IS_REQUIRED && !boost::filesystem::exists(file.second)) { - throw util::exception("Could not find required filed: " + std::get<1>(file).string()); + throw util::exception("Could not find required file(s): " + std::get<1>(file).string()); } }