Disable assert causing duplicated hash calls when NDEBUG is not defined - issue #168

This commit is contained in:
greg7mdp
2022-10-03 09:09:34 -04:00
parent acf0424bde
commit dc5bd3620e
+3
View File
@@ -2218,9 +2218,12 @@ protected:
PolicyTraits::construct(&alloc_ref(), slots_ + i,
std::forward<Args>(args)...);
#ifdef PHMAP_CHECK_CONSTRUCTED_VALUE
// this check can be costly, so do it only when requested
assert(PolicyTraits::apply(FindElement{*this}, *iterator_at(i)) ==
iterator_at(i) &&
"constructed value does not match the lookup key");
#endif
}
iterator iterator_at(size_t i) { return {ctrl_ + i, slots_ + i}; }