< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 3
Coverable lines: 3
Total lines: 23
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
IndexOfAnyMultiString(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Private.CoreLib/src/System/SearchValues/Strings/StringSearchValuesAhoCorasick.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Collections.Generic;
 5using System.Runtime.CompilerServices;
 6
 7namespace System.Buffers
 8{
 9    internal sealed class StringSearchValuesAhoCorasick<TCaseSensitivity, TFastScanVariant> : StringSearchValuesBase
 10        where TCaseSensitivity : struct, StringSearchValuesHelper.ICaseSensitivity
 11        where TFastScanVariant : struct, AhoCorasick.IFastScan
 12    {
 13        private readonly AhoCorasick _ahoCorasick;
 14
 015        public StringSearchValuesAhoCorasick(AhoCorasick ahoCorasick, HashSet<string> uniqueValues) : base(uniqueValues)
 016            _ahoCorasick = ahoCorasick;
 17
 18        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 19        internal override int IndexOfAnyMultiString(ReadOnlySpan<char> span) =>
 020            _ahoCorasick.IndexOfAny<TCaseSensitivity, TFastScanVariant>(span);
 21    }
 22}
 23