tidy: add clang-tidy modernize-use-starts-ends-with check

This commit is contained in:
Roman Zeyde
2024-09-06 23:07:46 +03:00
parent 2756797eca
commit fc7b507e9a
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())};