Commit 0a48146e authored by Max Kellermann's avatar Max Kellermann

client/Client: pass std::string_view to Write()

Almost all callers have string literal, and the length is known at compile time.
parent 0c4bf12b
...@@ -150,7 +150,9 @@ public: ...@@ -150,7 +150,9 @@ public:
/** /**
* Write a null-terminated string. * Write a null-terminated string.
*/ */
bool Write(const char *data) noexcept; bool Write(std::string_view s) noexcept {
return Write(s.data(), s.size());
}
/** /**
* returns the uid of the client process, or a negative value * returns the uid of the client process, or a negative value
......
...@@ -27,9 +27,3 @@ Client::Write(const void *data, size_t length) noexcept ...@@ -27,9 +27,3 @@ Client::Write(const void *data, size_t length) noexcept
/* if the client is going to be closed, do nothing */ /* if the client is going to be closed, do nothing */
return !IsExpired() && FullyBufferedSocket::Write(data, length); return !IsExpired() && FullyBufferedSocket::Write(data, length);
} }
bool
Client::Write(const char *data) noexcept
{
return Write(data, strlen(data));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment