From f252480beec0954ce0fe859efde21054537cb309 Mon Sep 17 00:00:00 2001 From: LeonineKing1199 Date: Thu, 2 Dec 2021 15:44:02 -0800 Subject: [PATCH] Add missing formatting --- include/boost/unordered/detail/implementation.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index a6ebce08..bebf7486 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -4055,21 +4055,28 @@ namespace boost { // no throw template - std::size_t erase_key_unique_impl(KeyEqual const& eq, Key const& k) { + std::size_t erase_key_unique_impl(KeyEqual const& eq, Key const& k) + { if (!this->size_) return 0; + std::size_t key_hash = this->hash(k); std::size_t bucket_index = this->hash_to_bucket(key_hash); - link_pointer prev = this->find_previous_node_impl(eq, k, bucket_index); + + link_pointer prev = + this->find_previous_node_impl(eq, k, bucket_index); + if (!prev) return 0; + node_pointer n = next_node(prev); node_pointer n2 = next_node(n); prev->next_ = n2; --size_; this->fix_bucket(bucket_index, prev, n2); this->destroy_node(n); - return 1; + + return 1; } std::size_t erase_key_unique(const_key_type& k)