From fb256d473ed33410d11be56244c565884c2f14bb Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 21 May 2025 18:13:30 +0800 Subject: internal: prefer direct pointers instead of (uintptr_t) converted ones --- src/sessionManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sessionManager.cpp') diff --git a/src/sessionManager.cpp b/src/sessionManager.cpp index a5dc713..4f68e2e 100644 --- a/src/sessionManager.cpp +++ b/src/sessionManager.cpp @@ -48,9 +48,9 @@ void CSessionManager::run() { newSession(); } -void CSessionManager::broadcast(const std::string &msg, std::optional self) const { +void CSessionManager::broadcast(const std::string &msg, std::optional self) const { for (const auto &[thread, session] : m_vSessions) - if (!self || (self && (uintptr_t)session.get() != *self)) + if (!self || (self && session.get() != *self)) session->write(msg); g_pIOManager->addCustom({"", msg}); @@ -108,7 +108,7 @@ void CSessionManager::kick(CSession *session, const bool kill, const std::string void CSessionManager::kick(std::pair> *session, const bool kill, const std::string &reason) { auto it = std::ranges::find_if(m_vSessions, [session](const auto &s) { return s.second.get() == session->second.get(); }); - g_pSessionManager->broadcast(NFormatter::fmt(NONEWLINE, "{} has left the chat", session->second->m_name), (uintptr_t)session->second.get()); + g_pSessionManager->broadcast(NFormatter::fmt(NONEWLINE, "{} has left the chat", session->second->m_name), session->second.get()); if (it != m_vSessions.end()) { if (!reason.empty()) { -- cgit v1.2.3