internal void ClearProcessor() { base.ClearContext(); this.flags = QueryProcessingFlags.Match; this.messageAction = null; this.messageId = null; this.messageSoapUri = null; this.messageTo = null; int subExprVarCount = this.matcher.SubExprVarCount; if (subExprVarCount == 0) { this.subExprVars = null; } else { SubExprVariable[] subExprVars = this.subExprVars; if (subExprVars == null) { this.subExprVars = new SubExprVariable[subExprVarCount]; } else { int length = subExprVars.Length; if (length != subExprVarCount) { this.subExprVars = new SubExprVariable[subExprVarCount]; } else if (length == 1) { NodeSequence seq = subExprVars[0].seq; if (seq != null) { this.ReleaseSequenceToPool(seq); } } else { for (int i = 0; i < length; i++) { NodeSequence sequence = subExprVars[i].seq; if ((sequence != null) && (sequence.refCount > 0)) { this.ReleaseSequenceToPool(sequence); } } Array.Clear(subExprVars, 0, subExprVars.Length); } } } }
internal QueryProcessor(QueryMatcher matcher) { base.Processor = this; this.matcher = matcher; this.flags = QueryProcessingFlags.Match; this.messageAction = null; this.messageId = null; this.messageSoapUri = null; this.messageTo = null; if (matcher.SubExprVarCount > 0) { this.subExprVars = new SubExprVariable[matcher.SubExprVarCount]; } }
internal QueryProcessor(QueryMatcher matcher) : base() { this.Processor = this; this.matcher = matcher; this.flags = QueryProcessingFlags.Match; // PERF, Microsoft, see if we can just let these to their default init this.messageAction = null; //this.messageAddress = null; //this.messageVia = null; this.messageId = null; this.messageSoapUri = null; this.messageTo = null; if (matcher.SubExprVarCount > 0) { this.subExprVars = new SubExprVariable[matcher.SubExprVarCount]; } }
internal void ClearProcessor() { base.ClearContext(); this.flags = QueryProcessingFlags.Match; this.messageAction = null; //this.messageAddress = null; //this.messageVia = null; this.messageId = null; this.messageSoapUri = null; this.messageTo = null; int exprCount = this.matcher.SubExprVarCount; if (exprCount == 0) { // No vars. Recycle entire subexpression cache this.subExprVars = null; return; } SubExprVariable[] vars = this.subExprVars; // save locally for speed if (vars == null) { // Allocate space for sub-expressions this.subExprVars = new SubExprVariable[exprCount]; return; } int varCount = vars.Length; // The # of subexpressions changed since this processor was last used. if (varCount != exprCount) { this.subExprVars = new SubExprVariable[exprCount]; return; } if (varCount == 1) { NodeSequence seq = vars[0].seq; if (seq != null) { this.ReleaseSequenceToPool(seq); } return; } // We can reuse the sub-expression cache // Clear out the sub-expression results from an earlier run, and return sequences to pool for (int i = 0; i < varCount; ++i) { NodeSequence seq = vars[i].seq; if (seq != null && seq.refCount > 0) { this.ReleaseSequenceToPool(seq); } } Array.Clear(vars, 0, vars.Length); }
internal QueryProcessor(QueryMatcher matcher) : base() { this.Processor = this; this.matcher = matcher; this.flags = QueryProcessingFlags.Match; // PERF, [....], see if we can just let these to their default init this.messageAction = null; //this.messageAddress = null; //this.messageVia = null; this.messageId = null; this.messageSoapUri = null; this.messageTo = null; if (matcher.SubExprVarCount > 0) { this.subExprVars = new SubExprVariable[matcher.SubExprVarCount]; } }