v29.4-roots.4 · Commit 20: [PATCH 20/37] modernize: use string_view prefix checks
src/node/mempool_args.cpp
Before: src/node/mempool_args.cpp · After: src/node/mempool_args.cpp
File metadata
index 0a53907f82194cf44e56df5e9d402ef17637d889..770a505c817820f975c41c248efbce83864944e9 100644
Download original patch · Release notes
Diff rows 1–16 of 16. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
src/node/mempool_args.cpp
CHANGED
|
@@ -67,7 +67,7 @@ util::Result<std::pair<int32_t, int>> ParseDustDynamicOpt(std::string_view optst
|
|
|
67
67
|
optstr.remove_prefix(pos + 1);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
if (optstr.rfind("target:", 0) == 0) {
|
|
70
|
+
if (optstr.starts_with("target:")) {
|
|
71
71
|
const auto val = ToIntegral<uint16_t>(optstr.substr(7));
|
|
72
72
|
if (!val) {
|
|
73
73
|
return util::Error{_("failed to parse target block count")};
|
|
@@ -79,7 +79,7 @@ util::Result<std::pair<int32_t, int>> ParseDustDynamicOpt(std::string_view optst
|
|
|
79
79
|
return util::Error{strprintf(_("target can only be at most %s blocks"), max_fee_estimate_blocks)};
|
|
80
80
|
}
|
|
81
81
|
return std::pair<int32_t, int>(-*val, multiplier);
|
|
82
|
-
} else if (optstr.rfind("mempool:", 0) == 0) {
|
|
82
|
+
} else if (optstr.starts_with("mempool:")) {
|
|
83
83
|
const auto val = ToIntegral<int32_t>(optstr.substr(8));
|
|
84
84
|
if (!val) {
|
|
85
85
|
return util::Error{_("failed to parse mempool position")};
|