This PR is a follow-up to #31306 and fixes the “modernize-use-starts-ends-with” warning in the multiprocess code (see #30975 (comment)).
Fixes https://github.com/chaincodelabs/libmultiprocess/issues/124.
This PR is a follow-up to #31306 and fixes the “modernize-use-starts-ends-with” warning in the multiprocess code (see #30975 (comment)).
Fixes https://github.com/chaincodelabs/libmultiprocess/issues/124.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31480.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
71@@ -72,7 +72,7 @@ static bool ParseAddress(std::string& address,
72 struct sockaddr_un& addr,
73 std::string& error)
74 {
75- if (address.compare(0, 4, "unix") == 0 && (address.size() == 4 || address[4] == ':')) {
76+ if (address.starts_with("unix") && (address.size() == 4 || address[4] == ':')) {
I think we can simplify this further:
0 if (address == "unix" || address.starts_with("unix:")) {
utACK df27ee9f024f69a8bdac8b0ee3bd7882f6a54294
This is much more readable too :)