mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 00:50:38 +08:00
Cleanup some clang-tidy issues
This commit is contained in:
Vendored
+6
-6
@@ -737,13 +737,13 @@ namespace priv {
|
||||
StringBtreeDefaultLess(std::less<std::string_view>) {} // NOLINT
|
||||
StringBtreeDefaultLess(phmap::Less<std::string_view>) {} // NOLINT
|
||||
|
||||
phmap::weak_ordering operator()(std::string_view lhs,
|
||||
std::string_view rhs) const {
|
||||
phmap::weak_ordering operator()(const std::string_view &lhs,
|
||||
const std::string_view &rhs) const {
|
||||
return compare_internal::compare_result_as_ordering(lhs.compare(rhs));
|
||||
}
|
||||
#else
|
||||
phmap::weak_ordering operator()(std::string lhs,
|
||||
std::string rhs) const {
|
||||
phmap::weak_ordering operator()(const std::string &lhs,
|
||||
const std::string &rhs) const {
|
||||
return compare_internal::compare_result_as_ordering(lhs.compare(rhs));
|
||||
}
|
||||
#endif
|
||||
@@ -763,8 +763,8 @@ namespace priv {
|
||||
return compare_internal::compare_result_as_ordering(rhs.compare(lhs));
|
||||
}
|
||||
#else
|
||||
phmap::weak_ordering operator()(std::string lhs,
|
||||
std::string rhs) const {
|
||||
phmap::weak_ordering operator()(const std::string &lhs,
|
||||
const std::string &rhs) const {
|
||||
return compare_internal::compare_result_as_ordering(rhs.compare(lhs));
|
||||
}
|
||||
#endif
|
||||
|
||||
Vendored
+3
-3
@@ -1190,9 +1190,9 @@ public:
|
||||
size_(phmap::exchange(that.size_, 0)),
|
||||
capacity_(phmap::exchange(that.capacity_, 0)),
|
||||
infoz_(phmap::exchange(that.infoz_, HashtablezInfoHandle())),
|
||||
// Hash, equality and allocator are copied instead of moved because
|
||||
// `that` must be left valid. If Hash is std::function<Key>, moving it
|
||||
// would create a nullptr functor that cannot be called.
|
||||
// Hash, equality and allocator are copied instead of moved because
|
||||
// `that` must be left valid. If Hash is std::function<Key>, moving it
|
||||
// would create a nullptr functor that cannot be called.
|
||||
settings_(that.settings_) {
|
||||
// growth_left was copied above, reset the one from `that`.
|
||||
that.growth_left() = 0;
|
||||
|
||||
Vendored
+7
-7
@@ -2047,7 +2047,7 @@ public:
|
||||
optional(const optional& src) = default;
|
||||
|
||||
// Move constructor, standard semantics
|
||||
optional(optional&& src) = default;
|
||||
optional(optional&& src) noexcept = default;
|
||||
|
||||
// Constructs a non-empty `optional` direct-initialized value of type `T` from
|
||||
// the arguments `std::forward<Args>(args)...` within the `optional`.
|
||||
@@ -2187,7 +2187,7 @@ public:
|
||||
optional& operator=(const optional& src) = default;
|
||||
|
||||
// Move assignment operator, standard semantics
|
||||
optional& operator=(optional&& src) = default;
|
||||
optional& operator=(optional&& src) noexcept = default;
|
||||
|
||||
// Value assignment operators
|
||||
template <
|
||||
@@ -4765,7 +4765,7 @@ public:
|
||||
DoNothing(mutex_type&, phmap::try_to_lock_t) {}
|
||||
template<class T> explicit DoNothing(T&&) {}
|
||||
DoNothing& operator=(const DoNothing&) { return *this; }
|
||||
DoNothing& operator=(DoNothing&&) { return *this; }
|
||||
DoNothing& operator=(DoNothing&&) noexcept { return *this; }
|
||||
void swap(DoNothing &) {}
|
||||
bool owns_lock() const noexcept { return true; }
|
||||
};
|
||||
@@ -4796,13 +4796,13 @@ public:
|
||||
m_->try_lock();
|
||||
}
|
||||
|
||||
WriteLock(WriteLock &&o) :
|
||||
WriteLock(WriteLock &&o) noexcept :
|
||||
m_(std::move(o.m_)), locked_(std::move(o.locked_)) {
|
||||
o.locked_ = false;
|
||||
o.m_ = nullptr;
|
||||
}
|
||||
|
||||
WriteLock& operator=(WriteLock&& other) {
|
||||
WriteLock& operator=(WriteLock&& other) noexcept {
|
||||
WriteLock temp(std::move(other));
|
||||
swap(temp);
|
||||
return *this;
|
||||
@@ -4874,13 +4874,13 @@ public:
|
||||
m_->try_lock_shared();
|
||||
}
|
||||
|
||||
ReadLock(ReadLock &&o) :
|
||||
ReadLock(ReadLock &&o) noexcept :
|
||||
m_(std::move(o.m_)), locked_(std::move(o.locked_)) {
|
||||
o.locked_ = false;
|
||||
o.m_ = nullptr;
|
||||
}
|
||||
|
||||
ReadLock& operator=(ReadLock&& other) {
|
||||
ReadLock& operator=(ReadLock&& other) noexcept {
|
||||
ReadLock temp(std::move(other));
|
||||
swap(temp);
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user