public virtual void ProcessMatchResult(IMatchResultBase matchResult) { int matchedResultCount = 0; int suppressedCount = 0; GetMatchesCount(matchResult, ref matchedResultCount, ref suppressedCount); Interlocked.Add(ref totalMatchesCount, matchedResultCount); Interlocked.Add(ref totalSuppressedCount, suppressedCount); }
protected static void GetMatchesCount(IMatchResultBase matchResult, ref int matchedResultCount, ref int suppressedCount) { int patternsCount = PatternRoot.ExtractKeys(matchResult.PatternKey).Length; if (patternsCount == 0) { patternsCount = 1; } matchedResultCount += patternsCount; if (matchResult.Suppressed) { suppressedCount += patternsCount; } }