refactor: starts/ends_with changes for clang-tidy 20

This commit is contained in:
fanquake
2025-03-18 08:04:23 +08:00
parent 96a5cd8000
commit 2b85d31bcc
11 changed files with 16 additions and 16 deletions

View File

@@ -1220,7 +1220,7 @@ static int CommandLineRPC(int argc, char *argv[])
if (gArgs.GetBoolArg("-stdinwalletpassphrase", false)) {
NO_STDIN_ECHO();
std::string walletPass;
if (args.size() < 1 || args[0].substr(0, 16) != "walletpassphrase") {
if (args.size() < 1 || !args[0].starts_with("walletpassphrase")) {
throw std::runtime_error("-stdinwalletpassphrase is only applicable for walletpassphrase(change)");
}
if (!StdinReady()) {