mirror of
https://github.com/znc/znc.git
synced 2026-06-28 22:11:14 +02:00
Prefer StartsWith(s) over Left(n) == s
This commit is contained in:
+3
-3
@@ -85,18 +85,18 @@ bool CConfig::Parse(CFile& file, CString& sErrorMsg)
|
||||
sLine.TrimLeft();
|
||||
sLine.TrimRight("\r\n");
|
||||
|
||||
if (bCommented || sLine.Left(2) == "/*") {
|
||||
if (bCommented || sLine.StartsWith("/*")) {
|
||||
/* Does this comment end on the same line again? */
|
||||
bCommented = (sLine.Right(2) != "*/");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sLine.empty()) || (sLine[0] == '#') || (sLine.Left(2) == "//")) {
|
||||
if ((sLine.empty()) || (sLine.StartsWith("#")) || (sLine.StartsWith("//"))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sLine.Left(1) == "<") && (sLine.Right(1) == ">")) {
|
||||
if ((sLine.StartsWith("<")) && (sLine.Right(1) == ">")) {
|
||||
sLine.LeftChomp();
|
||||
sLine.RightChomp();
|
||||
sLine.Trim();
|
||||
|
||||
Reference in New Issue
Block a user