From 7a1a25991f463d657f9e5e44eba539040c2193c7 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Wed, 28 Sep 2022 09:45:55 +0200 Subject: [PATCH] removed unnecessary check in max_load --- include/boost/unordered/detail/foa.hpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 2970b594..4e635550 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -729,15 +729,10 @@ private: std::size_t max_load()const { - if(!arrays.elements){ - return 0; - } - else { - float fml=mlf*(float)(capacity()); - auto res=(std::numeric_limits::max)(); - if(res>(std::size_t)fml)res=(std::size_t)fml; - return res; - } + float fml=mlf*(float)(capacity()); + auto res=(std::numeric_limits::max)(); + if(res>(std::size_t)fml)res=(std::size_t)fml; + return res; } static inline auto key_from(const value_type& x)