Cleanup some clang-tidy issues

This commit is contained in:
greg7mdp
2023-04-23 19:40:33 -04:00
parent e4b6668d46
commit 16287ccca6
8 changed files with 27 additions and 21 deletions
+6 -6
View File
@@ -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
+3 -3
View File
@@ -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;
+7 -7
View File
@@ -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;