< Summary

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

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
 43613        public ProbabilisticCharSearchValues(ReadOnlySpan<char> values, int maxInclusive)
 14        {
 43615            _map = new ProbabilisticMapState(values, maxInclusive);
 43616        }
 17
 18        internal override char[] GetValues() =>
 019            _map.GetValues();
 20
 21        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 22        internal override bool ContainsCore(char value) =>
 14092523            _map.FastContains(value);
 24
 25        internal override int IndexOfAny(ReadOnlySpan<char> span) =>
 174426            ProbabilisticMap.IndexOfAny<SearchValues.TrueConst>(ref MemoryMarshal.GetReference(span), span.Length, ref _
 27
 28        internal override int IndexOfAnyExcept(ReadOnlySpan<char> span) =>
 174429            ProbabilisticMapState.IndexOfAnySimpleLoop<SearchValues.TrueConst, IndexOfAnyAsciiSearcher.Negate>(ref Memor
 30
 31        internal override int LastIndexOfAny(ReadOnlySpan<char> span) =>
 87232            ProbabilisticMap.LastIndexOfAny<SearchValues.TrueConst>(ref MemoryMarshal.GetReference(span), span.Length, r
 33
 34        internal override int LastIndexOfAnyExcept(ReadOnlySpan<char> span) =>
 87235            ProbabilisticMapState.LastIndexOfAnySimpleLoop<SearchValues.TrueConst, IndexOfAnyAsciiSearcher.Negate>(ref M
 36    }
 37}
 38