From 5ad86f559f08bed29f055eafc86b67cd30cdad1e Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 6 Sep 2022 14:33:24 -0700 Subject: [PATCH] Clean up implementation of recalculate_max_load() to avoid std::floor/std::ceil --- include/boost/unordered/detail/implementation.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index 3756a50f..81872612 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -2071,8 +2071,6 @@ namespace boost { void recalculate_max_load() { - using namespace std; - // From 6.3.1/13: // Only resize when size >= mlf_ * count std::size_t const bc = buckets_.bucket_count(); @@ -2083,8 +2081,8 @@ namespace boost { // max_load_ = bc == 0 ? 0 - : boost::unordered::detail::double_to_size(floor( - static_cast(mlf_) * static_cast(bc))); + : boost::unordered::detail::double_to_size( + static_cast(mlf_) * static_cast(bc)); } void max_load_factor(float z)