Merge bitcoin/bitcoin#30868: refactor: add clang-tidy modernize-use-starts-ends-with check

fc7b507e9a tidy: add clang-tidy `modernize-use-starts-ends-with` check (Roman Zeyde)

Pull request description:

ACKs for top commit:
  jonatack:
    re-ACK fc7b507e9a only change since my previous ACK is the commit message
  achow101:
    ACK fc7b507e9a
  stickies-v:
    ACK fc7b507e9a
  hebasto:
    ACK fc7b507e9a, I have reviewed the code and it looks OK.

Tree-SHA512: 334e0ff91b9b108a57cdfc12ee53685b792d377e11124c7c394b8f681a8168a8d65a56c7f884555238e65e97e9ad62ede52b79219ce258979e54abdd76721df1
This commit is contained in:
Ava Chow
2024-09-16 15:47:04 -04:00
4 changed files with 4 additions and 3 deletions

View File

@@ -230,7 +230,7 @@ CService LookupNumeric(const std::string& name, uint16_t portDefault, DNSLookupF
bool IsUnixSocketPath(const std::string& name)
{
#ifdef HAVE_SOCKADDR_UN
if (name.find(ADDR_PREFIX_UNIX) != 0) return false;
if (!name.starts_with(ADDR_PREFIX_UNIX)) return false;
// Split off "unix:" prefix
std::string str{name.substr(ADDR_PREFIX_UNIX.length())};