mirror of
https://github.com/znc/znc.git
synced 2026-08-06 00:43:19 +02:00
Prefer TrimPrefix() over Left() + LeftChomp()
This commit is contained in:
+2
-4
@@ -695,9 +695,8 @@ bool CTemplate::ValidExpr(const CString& sExpression) {
|
||||
CString sName;
|
||||
CString sValue;
|
||||
|
||||
if (sExpr.Left(1) == "!") {
|
||||
if (sExpr.TrimPrefix("!")) {
|
||||
bNegate = true;
|
||||
sExpr.LeftChomp();
|
||||
}
|
||||
|
||||
if (sExpr.find("!=") != CString::npos) {
|
||||
@@ -810,8 +809,7 @@ CString CTemplate::GetValue(const CString& sArgs, bool bFromIf) {
|
||||
return sRet;
|
||||
}
|
||||
} else {
|
||||
if (sName.Left(1) == "*") {
|
||||
sName.LeftChomp(1);
|
||||
if (sName.TrimPrefix("*")) {
|
||||
MCString::iterator it = find(sName);
|
||||
sName = (it != end()) ? it->second : "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user