From 9a73401361f8be274536164d42ba10ace050f982 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 12 Mar 2025 21:22:13 +0800 Subject: clang-tidy --- src/session.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/session.cpp') diff --git a/src/session.cpp b/src/session.cpp index 463e16a..655243e 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -79,20 +79,19 @@ CSession::SRecvData CSession::read() { } onRecv(recvData); - m_isReading = false; + m_isReading = false; return recvData; } CSession::SRecvData CSession::read(const std::string &msg) { write({}, "{}", msg, false); - m_isReading = true; + m_isReading = true; return read(); } void CSession::run() { onConnect(); - registerSession() ? recvLoop() : - log(LOG, "Client {} exited without even registering", m_ip); + registerSession() ? recvLoop() : log(LOG, "Client {} exited without even registering", m_ip); g_pSessionManager->removeSession(self); } @@ -133,8 +132,8 @@ bool CSession::isValid() { template bool CSession::write(eFormatType type, std::format_string fmt, Args &&...args) { std::string msg = NFormatter::fmt(type, fmt, std::forward(args)...); - if (m_isReading) - msg.insert(0, "\n"); + if (m_isReading) + msg.insert(0, "\n"); if (send(m_sockfd.get(), msg.c_str(), msg.size(), 0) < 0) { onErrno(WRITE); -- cgit v1.2.3