refactor: enable readability-container-contains clang-tidy rule
Replace the last few instances of `.count() != 0` and `.count() == 0` and `.count()` patterns with the more expressive C++20 `.contains()` method: * `std::set<std::string>` in `getblocktemplate` RPC; * `std::map<std::string, ...>` in `transaction_tests`; * other bare `std::unordered_set` and `std::map` count calls. With no remaining violations, enable the `readability-container-contains` clang-tidy check to prevent future regressions.
This commit is contained in:
5 files changed
+11
-10
No files matched your search
@@ -125,7 +125,7 @@ FUZZ_TARGET(scriptpubkeyman, .init = initialize_spkm)
|
||||
[&] {
|
||||
const CScript script{ConsumeScript(fuzzed_data_provider)};
|
||||
if (spk_manager->IsMine(script)) {
|
||||
assert(spk_manager->GetScriptPubKeys().count(script));
|
||||
assert(spk_manager->GetScriptPubKeys().contains(script));
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
|
||||
Reference in new issue
Block a user