mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 00:50:38 +08:00
cleanup some test failures.
This commit is contained in:
Vendored
+14
-8
@@ -137,18 +137,19 @@ constexpr bool IsNoThrowSwappable() {
|
||||
// --------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
int TrailingZeros(T x) {
|
||||
return sizeof(T) == 8 ? base_internal::CountTrailingZerosNonZero64(
|
||||
static_cast<uint64_t>(x))
|
||||
: base_internal::CountTrailingZerosNonZero32(
|
||||
static_cast<uint32_t>(x));
|
||||
PHMAP_IF_CONSTEXPR(sizeof(T) == 8)
|
||||
return base_internal::CountTrailingZerosNonZero64(static_cast<uint64_t>(x));
|
||||
else
|
||||
return base_internal::CountTrailingZerosNonZero32(static_cast<uint32_t>(x));
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
int LeadingZeros(T x) {
|
||||
return sizeof(T) == 8
|
||||
? base_internal::CountLeadingZeros64(static_cast<uint64_t>(x))
|
||||
: base_internal::CountLeadingZeros32(static_cast<uint32_t>(x));
|
||||
PHMAP_IF_CONSTEXPR(sizeof(T) == 8)
|
||||
return base_internal::CountLeadingZeros64(static_cast<uint64_t>(x));
|
||||
else
|
||||
return base_internal::CountLeadingZeros32(static_cast<uint32_t>(x));
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -1432,7 +1433,12 @@ public:
|
||||
|
||||
// This overload is necessary because otherwise erase<K>(const K&) would be
|
||||
// a better match if non-const iterator is passed as an argument.
|
||||
iterator erase(iterator it) { _erase(it++); return it; }
|
||||
iterator erase(iterator it) {
|
||||
auto res = it;
|
||||
++res;
|
||||
_erase(it);
|
||||
return res;
|
||||
}
|
||||
|
||||
iterator erase(const_iterator first, const_iterator last) {
|
||||
while (first != last) {
|
||||
|
||||
Reference in New Issue
Block a user