mirror of
https://github.com/znc/znc.git
synced 2026-05-06 05:22:26 +02:00
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
This commit is contained in:
5
znc.cpp
5
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;
|
||||
|
||||
Reference in New Issue
Block a user