Prefer StartsWith(s) over Left(n) == s

This commit is contained in:
J-P Nurmi
2015-08-14 12:34:27 +02:00
parent 52395fad5e
commit 4995e7517e
10 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -96,7 +96,7 @@ void CClient::ReadLine(const CString& sData) {
DEBUG("(" << GetFullName() << ") CLI -> ZNC [" << sLine << "]");
if (sLine.Left(1) == "@") {
if (sLine.StartsWith("@")) {
// TODO support message-tags properly
sLine = sLine.Token(1, true);
}
@@ -110,7 +110,7 @@ void CClient::ReadLine(const CString& sData) {
if (bReturn) return;
CString sCommand = sLine.Token(0);
if (sCommand.Left(1) == ":") {
if (sCommand.StartsWith(":")) {
// Evil client! Sending a nickmask prefix on client's command
// is bad, bad, bad, bad, bad, bad, bad, bad, BAD, B A D!
sLine = sLine.Token(1, true);