未验证 提交 65c4dbe9 编写于 作者: T ThomasGoulet73 提交者: GitHub

Small performance improvement of PathParser (#4208)

上级 fa202b69
......@@ -189,7 +189,7 @@ void AddProperty()
while (_index < _n && _path[_index] == '.')
++_index;
while (_index < _n && (level > 0 || SpecialChars.IndexOf(_path[_index]) < 0))
while (_index < _n && (level > 0 || !IsSpecialChar(_path[_index])))
{
if (_path[_index] == '(')
++level;
......@@ -386,6 +386,11 @@ void StartNewLevel()
_drillIn = DrillIn.Never;
}
private static bool IsSpecialChar(char ch)
{
return ch == '.' || ch == '/' || ch == '[' || ch == ']';
}
State _state;
string _path;
int _index;
......@@ -395,7 +400,6 @@ void StartNewLevel()
const char NullChar = Char.MinValue;
const char EscapeChar = '^';
static SourceValueInfo[] EmptyInfo = Array.Empty<SourceValueInfo>();
static string SpecialChars = @"./[]";
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册