Pass string views by value
string_view should always be passed by value; This commit is a sed
replace of the code to make all string_views pass by value, per general
coding guidelines[1].
[1] https://quuxplusone.github.io/blog/2021/11/09/pass-string-view-by-value/
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I55b342a29a0fbfce0a4ed9ea63db6014d03b134c
diff --git a/http/websocket.hpp b/http/websocket.hpp
index 0ab13f2..c36e579 100644
--- a/http/websocket.hpp
+++ b/http/websocket.hpp
@@ -148,7 +148,7 @@
});
}
- void sendBinary(const std::string_view msg) override
+ void sendBinary(std::string_view msg) override
{
ws.binary(true);
outBuffer.emplace_back(msg);
@@ -162,7 +162,7 @@
doWrite();
}
- void sendText(const std::string_view msg) override
+ void sendText(std::string_view msg) override
{
ws.text(true);
outBuffer.emplace_back(msg);
@@ -176,7 +176,7 @@
doWrite();
}
- void close(const std::string_view msg) override
+ void close(std::string_view msg) override
{
ws.async_close(
{boost::beast::websocket::close_code::normal, msg},