mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
refactor: increase string_view usage
Update select functions that take a const std::string& to take a
std::string_view instead. In a next commit, this allows us to use
the {Arg,MaybeArg}<std::string_view> helper.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include <string_view>
|
||||
|
||||
#include <blockfilter.h>
|
||||
#include <crypto/siphash.h>
|
||||
@@ -151,7 +152,8 @@ const std::string& BlockFilterTypeName(BlockFilterType filter_type)
|
||||
return it != g_filter_types.end() ? it->second : unknown_retval;
|
||||
}
|
||||
|
||||
bool BlockFilterTypeByName(const std::string& name, BlockFilterType& filter_type) {
|
||||
bool BlockFilterTypeByName(std::string_view name, BlockFilterType& filter_type)
|
||||
{
|
||||
for (const auto& entry : g_filter_types) {
|
||||
if (entry.second == name) {
|
||||
filter_type = entry.first;
|
||||
|
||||
Reference in New Issue
Block a user