Merge bitcoin/bitcoin#31480: refactor: Fix "modernize-use-starts-ends-with" clang-tidy warning
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run

df27ee9f02 refactor: Fix "modernize-use-starts-ends-with" clang-tidy warning (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up to #31306 and fixes the "modernize-use-starts-ends-with" warning in the multiprocess code (see https://github.com/bitcoin/bitcoin/pull/30975#issuecomment-2527008761).

  Fixes https://github.com/chaincodelabs/libmultiprocess/issues/124.

ACKs for top commit:
  l0rinc:
    ACK df27ee9f02
  theuni:
    utACK df27ee9f02
  ryanofsky:
    Code review ACK df27ee9f02

Tree-SHA512: b5685818e9a3f161949b79586138e4341c5fbcc77296d5f4b13ff0183b6efaac1baea8a6d9304566f25517018d4f67b6d407105a36971a03f4077697d53f17ff
This commit is contained in:
Ryan Ofsky 2024-12-12 16:57:12 -05:00
commit beac62e541
No known key found for this signature in database
GPG key ID: 46800E30FC748A66

View file

@ -72,7 +72,7 @@ static bool ParseAddress(std::string& address,
struct sockaddr_un& addr,
std::string& error)
{
if (address.compare(0, 4, "unix") == 0 && (address.size() == 4 || address[4] == ':')) {
if (address == "unix" || address.starts_with("unix:")) {
fs::path path;
if (address.size() <= 5) {
path = data_dir / fs::PathFromString(strprintf("%s.sock", RemovePrefixView(dest_exe_name, "bitcoin-")));