未验证 提交 61e250a1 编写于 作者: S Stephen Toub 提交者: GitHub

Lazy-allocate ValidationState.CurPos (#54346)

The array is only used for a subset of validators; no point in paying for this array for every ValidationState instance even if it's not going to be used.
上级 034986bf
......@@ -42,7 +42,8 @@ internal sealed class ValidationState
public bool HasMatched; // whether the element has been verified correctly
//For NFAs
public BitSet[] CurPos = new BitSet[2];
private BitSet[]? _curPos;
public BitSet[] CurPos => _curPos ??= new BitSet[2];
//For all
public BitSet? AllElementsSet;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册