mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:37:46 +00:00
Everywhere: Pass AK::StringView by value
This commit is contained in:
parent
ad5d217e76
commit
8b1108e485
392 changed files with 978 additions and 978 deletions
|
@ -25,7 +25,7 @@ Client::Client(int id, RefPtr<Core::TCPSocket> socket, int ptm_fd)
|
|||
m_socket->on_ready_to_read = [this] { drain_socket(); };
|
||||
m_ptm_notifier->on_ready_to_read = [this] { drain_pty(); };
|
||||
m_parser.on_command = [this](const Command& command) { handle_command(command); };
|
||||
m_parser.on_data = [this](const StringView& data) { handle_data(data); };
|
||||
m_parser.on_data = [this](StringView data) { handle_data(data); };
|
||||
m_parser.on_error = [this]() { handle_error(); };
|
||||
send_commands({
|
||||
{ CMD_WILL, SUB_SUPPRESS_GO_AHEAD },
|
||||
|
@ -66,7 +66,7 @@ void Client::drain_pty()
|
|||
send_data(StringView(buffer, (size_t)nread));
|
||||
}
|
||||
|
||||
void Client::handle_data(const StringView& data)
|
||||
void Client::handle_data(StringView data)
|
||||
{
|
||||
write(m_ptm_fd, data.characters_without_null_termination(), data.length());
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ protected:
|
|||
|
||||
void drain_socket();
|
||||
void drain_pty();
|
||||
void handle_data(const StringView&);
|
||||
void handle_data(StringView);
|
||||
void handle_command(const Command& command);
|
||||
void handle_error();
|
||||
void send_data(StringView str);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "Parser.h"
|
||||
|
||||
void Parser::write(const StringView& data)
|
||||
void Parser::write(StringView data)
|
||||
{
|
||||
for (size_t i = 0; i < data.length(); i++) {
|
||||
u8 ch = data[i];
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
class Parser {
|
||||
public:
|
||||
Function<void(const Command&)> on_command;
|
||||
Function<void(const StringView&)> on_data;
|
||||
Function<void(StringView)> on_data;
|
||||
Function<void()> on_error;
|
||||
|
||||
void write(const StringView&);
|
||||
void write(StringView);
|
||||
|
||||
protected:
|
||||
enum State {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue