From 9933ba9c3e2f2c61e9f593916827a7d10de1bb0f Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 5 Jan 2009 11:45:12 +0000 Subject: [PATCH] Use CString::TrimRight() to make this code more readable git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1321 726aef4b-f618-498e-8847-2d620e286838 --- Client.cpp | 4 +--- IRCSock.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Client.cpp b/Client.cpp index 1189dbd2..eb189e8f 100644 --- a/Client.cpp +++ b/Client.cpp @@ -63,9 +63,7 @@ CClient::~CClient() { void CClient::ReadLine(const CString& sData) { CString sLine = sData; - while ((sLine.Right(1) == "\r") || (sLine.Right(1) == "\n")) { - sLine.RightChomp(); - } + sLine.TrimRight("\n\r"); DEBUG_ONLY(cout << "(" << ((m_pUser) ? m_pUser->GetUserName() : GetRemoteIP()) << ") CLI -> ZNC [" << sLine << "]" << endl); diff --git a/IRCSock.cpp b/IRCSock.cpp index b11a39c7..beac360e 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -71,9 +71,7 @@ void CIRCSock::Quit() { void CIRCSock::ReadLine(const CString& sData) { CString sLine = sData; - while ((sLine.Right(1) == "\r") || (sLine.Right(1) == "\n")) { - sLine.RightChomp(); - } + sLine.TrimRight("\n\r"); DEBUG_ONLY(cout << "(" << m_pUser->GetUserName() << ") IRC -> ZNC [" << sLine << "]" << endl);