Skip to content

Commit

Permalink
Address cert-oop54-cpp warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis committed Jan 16, 2024
1 parent d24299d commit d850710
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Checks: >
-bugprone-unused-raii,
cert-*,
-cert-err58-cpp,
-cert-oop54-cpp,
-clang-analyzer-*,
clang-diagnostic-*,
concurrency-*,
Expand Down
3 changes: 3 additions & 0 deletions silkworm/core/common/small_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class SmallMap {
}
}
constexpr SmallMap& operator=(const SmallMap& other) {
if (this == &other) {
return *this;
}
size_ = other.size_;
for (size_t i{0}; i < max_size; ++i) {
data_[i] = other.data_[i];
Expand Down
3 changes: 3 additions & 0 deletions silkworm/core/concurrency/resettable_once_flag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class ResettableOnceFlag {
}
}
ResettableOnceFlag& operator=(const ResettableOnceFlag& other) {
if (this == &other) {
return *this;
}
const uint32_t other_flag{other.flag_.load(std::memory_order_acquire)};
if (other_flag == absl::base_internal::kOnceDone) {
flag_.store(absl::base_internal::kOnceDone, std::memory_order_release);
Expand Down

0 comments on commit d850710

Please sign in to comment.