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:
Aurèle Oulès
2022-07-26 11:12:53 +02:00
parent 7f79746bf0
commit 081b0e53e3
27 changed files with 39 additions and 39 deletions

View File

@@ -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;