aboutsummaryrefslogtreecommitdiff
path: root/src/blockfilter.cpp
diff options
context:
space:
mode:
authorAurèle Oulès <aurele@oules.com>2022-07-26 11:12:53 +0200
committerAurèle Oulès <aurele@oules.com>2022-07-27 13:27:57 +0200
commit081b0e53e3adca7ea57d23e5fcd9db4b86415a72 (patch)
tree877f1eb2d246084e645f8cf5961d5541438a308b /src/blockfilter.cpp
parent7f79746bf046d0028bb68f265804b9774dec2acb (diff)
downloadbitcoin-081b0e53e3adca7ea57d23e5fcd9db4b86415a72.tar.xz
refactor: Make const refs vars where applicable
This avoids initializing variables with the copy-constructor of a non-trivially copyable type.
Diffstat (limited to 'src/blockfilter.cpp')
-rw-r--r--src/blockfilter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blockfilter.cpp b/src/blockfilter.cpp
index 0ff79bb3ca..43d88df720 100644
--- a/src/blockfilter.cpp
+++ b/src/blockfilter.cpp
@@ -169,7 +169,7 @@ const std::set<BlockFilterType>& AllBlockFilterTypes()
static std::once_flag flag;
std::call_once(flag, []() {
- for (auto entry : g_filter_types) {
+ for (const auto& entry : g_filter_types) {
types.insert(entry.first);
}
});
@@ -185,7 +185,7 @@ const std::string& ListBlockFilterTypes()
std::call_once(flag, []() {
std::stringstream ret;
bool first = true;
- for (auto entry : g_filter_types) {
+ for (const auto& entry : g_filter_types) {
if (!first) ret << ", ";
ret << entry.second;
first = false;