net/SocketAddress: use std::string_view::find() instead of std::memchr()
This commit is contained in:
parent
cbba22c947
commit
7c9b7fa311
|
@ -56,10 +56,9 @@ SocketAddress::GetLocalPath() const noexcept
|
|||
return !raw.empty() &&
|
||||
/* must be an absolute path */
|
||||
raw.front() == '/' &&
|
||||
/* must be null-terminated */
|
||||
raw.back() == 0 &&
|
||||
/* there must not be any other null byte */
|
||||
std::memchr(raw.data(), 0, raw.size() - 1) == nullptr
|
||||
/* must be null-terminated and there must not be any
|
||||
other null byte */
|
||||
raw.find('\0') == raw.size() - 1
|
||||
? raw.data()
|
||||
: nullptr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue