< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 38
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%
GetValues()100%110%
ContainsCore(...)100%110%
IndexOfAny(...)100%110%
IndexOfAnyExcept(...)100%110%
LastIndexOfAny(...)100%110%
LastIndexOfAnyExcept(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticCharSearchValues.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.Runtime.CompilerServices;
 5using System.Runtime.InteropServices;
 6
 7namespace System.Buffers
 8{
 9    internal sealed class ProbabilisticCharSearchValues : SearchValues<char>
 10    {
 11        private ProbabilisticMapState _map;
 12
 013        public ProbabilisticCharSearchValues(ReadOnlySpan<char> values, int maxInclusive)
 14        {
 015            _map = new ProbabilisticMapState(values, maxInclusive);
 016        }
 17
 18        internal override char[] GetValues() =>
 019            _map.GetValues();
 20
 21        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 22        internal override bool ContainsCore(char value) =>
 023            _map.FastContains(value);
 24
 25        internal override int IndexOfAny(ReadOnlySpan<char> span) =>
 026            ProbabilisticMap.IndexOfAny<SearchValues.TrueConst>(ref MemoryMarshal.GetReference(span), span.Length, ref _
 27
 28        internal override int IndexOfAnyExcept(ReadOnlySpan<char> span) =>
 029            ProbabilisticMapState.IndexOfAnySimpleLoop<SearchValues.TrueConst, IndexOfAnyAsciiSearcher.Negate>(ref Memor
 30
 31        internal override int LastIndexOfAny(ReadOnlySpan<char> span) =>
 032            ProbabilisticMap.LastIndexOfAny<SearchValues.TrueConst>(ref MemoryMarshal.GetReference(span), span.Length, r
 33
 34        internal override int LastIndexOfAnyExcept(ReadOnlySpan<char> span) =>
 035            ProbabilisticMapState.LastIndexOfAnySimpleLoop<SearchValues.TrueConst, IndexOfAnyAsciiSearcher.Negate>(ref M
 36    }
 37}
 38