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
+3 -3
View File
@@ -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();