mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Use std::string_view throughout util strencodings/string
This commit is contained in:
parent
8ffbd1412d
commit
e7d2fbda63
9 changed files with 69 additions and 56 deletions
|
|
@ -853,8 +853,8 @@ static bool GetConfigOptions(std::istream& stream, const std::string& filepath,
|
|||
error = strprintf("parse error on line %i: %s, options in configuration file must be specified without leading -", linenr, str);
|
||||
return false;
|
||||
} else if ((pos = str.find('=')) != std::string::npos) {
|
||||
std::string name = prefix + TrimString(str.substr(0, pos), pattern);
|
||||
std::string value = TrimString(str.substr(pos + 1), pattern);
|
||||
std::string name = prefix + TrimString(std::string_view{str}.substr(0, pos), pattern);
|
||||
std::string_view value = TrimStringView(std::string_view{str}.substr(pos + 1), pattern);
|
||||
if (used_hash && name.find("rpcpassword") != std::string::npos) {
|
||||
error = strprintf("parse error on line %i, using # in rpcpassword can be ambiguous and should be avoided", linenr);
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue