From 3b0a4dc4b5f5aaa8ae40b3b902b468f5dbb7ff01 Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 11 Jul 2008 09:58:04 +0000 Subject: [PATCH] Config reading: Apply a small (unnoticeable) optimization Trim() always removes all trailing and leading spaces and line endings from that string, so there is no point in this main loop. It will always run once, anyway. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1124 726aef4b-f618-498e-8847-2d620e286838 --- znc.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/znc.cpp b/znc.cpp index 18601276..f8674d5f 100644 --- a/znc.cpp +++ b/znc.cpp @@ -984,9 +984,8 @@ bool CZNC::DoRehash(CString& sError) while (File.ReadLine(sLine)) { uLineNum++; - while ((sLine.Right(1) == "\r") || (sLine.Right(1) == "\n")) { - sLine.Trim(); - } + // Remove all leading / trailing spaces and line endings + sLine.Trim(); if ((sLine.empty()) || (sLine[0] == '#') || (sLine.Left(2) == "//")) { continue;