mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
refactor: Make const refs vars where applicable
This avoids initializing variables with the copy-constructor of a non-trivially copyable type.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user