From 1fa2e84774aaab1314c571be51eca17ca5ee5a36 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 10 Oct 2022 19:24:14 +0200 Subject: [PATCH] reverted 7caab660113c2c2d1b62024dadd21942ec5ef267 and f776ffa0085aa1e6602253d94fe026a1c17ea336 --- include/boost/unordered/detail/foa.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 356f58ed..f379e80e 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -1315,7 +1315,7 @@ private: } template - std::size_t hash_for(const Key& x)const + inline std::size_t hash_for(const Key& x)const { return mix_policy::mix(h()(x)); } @@ -1375,9 +1375,10 @@ private: template BOOST_FORCEINLINE std::pair emplace_impl(Args&&... args) { - auto hash=hash_for(key_from(args...)); - auto pos0=position_for(hash); - auto it=find_impl(key_from(args...),pos0,hash); + const auto &k=key_from(std::forward(args)...); + auto hash=hash_for(k); + auto pos0=position_for(hash); + auto it=find_impl(k,pos0,hash); if(it!=end()){ return {it,false};