refactor: Fix "modernize-use-starts-ends-with" clang-tidy warning

This commit is contained in:
Hennadii Stepanov 2024-12-12 10:27:24 +00:00
parent ea9e64ff3c
commit df27ee9f02
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

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-")));