< Summary

Line coverage
93%
Covered lines: 15
Uncovered lines: 1
Coverable lines: 16
Total lines: 75
Line coverage: 93.7%
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%
ContainsAny(...)100%11100%
ContainsAnyExcept(...)100%11100%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Private.CoreLib/src/System/SearchValues/AnyByteSearchValues.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;
 6using System.Runtime.Intrinsics.Arm;
 7using System.Runtime.Intrinsics.Wasm;
 8using System.Runtime.Intrinsics.X86;
 9
 10namespace System.Buffers
 11{
 12    internal sealed class AnyByteSearchValues : SearchValues<byte>
 13    {
 14        private IndexOfAnyAsciiSearcher.AnyByteState _state;
 15
 282416        public AnyByteSearchValues(ReadOnlySpan<byte> values) =>
 282417            IndexOfAnyAsciiSearcher.ComputeAnyByteState(values, out _state);
 18
 19        internal override byte[] GetValues() =>
 020            _state.Lookup.GetByteValues();
 21
 22        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 23        internal override bool ContainsCore(byte value) =>
 63862124            _state.Lookup.Contains(value);
 25
 26        [CompExactlyDependsOn(typeof(Ssse3))]
 27        [CompExactlyDependsOn(typeof(AdvSimd))]
 28        [CompExactlyDependsOn(typeof(PackedSimd))]
 29        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 30        internal override int IndexOfAny(ReadOnlySpan<byte> span) =>
 847231            IndexOfAnyAsciiSearcher.IndexOfAny<IndexOfAnyAsciiSearcher.DontNegate>(
 847232                ref MemoryMarshal.GetReference(span), span.Length, ref _state);
 33
 34        [CompExactlyDependsOn(typeof(Ssse3))]
 35        [CompExactlyDependsOn(typeof(AdvSimd))]
 36        [CompExactlyDependsOn(typeof(PackedSimd))]
 37        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 38        internal override int IndexOfAnyExcept(ReadOnlySpan<byte> span) =>
 847239            IndexOfAnyAsciiSearcher.IndexOfAny<IndexOfAnyAsciiSearcher.Negate>(
 847240                ref MemoryMarshal.GetReference(span), span.Length, ref _state);
 41
 42        [CompExactlyDependsOn(typeof(Ssse3))]
 43        [CompExactlyDependsOn(typeof(AdvSimd))]
 44        [CompExactlyDependsOn(typeof(PackedSimd))]
 45        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 46        internal override int LastIndexOfAny(ReadOnlySpan<byte> span) =>
 564847            IndexOfAnyAsciiSearcher.LastIndexOfAny<IndexOfAnyAsciiSearcher.DontNegate>(
 564848                ref MemoryMarshal.GetReference(span), span.Length, ref _state);
 49
 50        [CompExactlyDependsOn(typeof(Ssse3))]
 51        [CompExactlyDependsOn(typeof(AdvSimd))]
 52        [CompExactlyDependsOn(typeof(PackedSimd))]
 53        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 54        internal override int LastIndexOfAnyExcept(ReadOnlySpan<byte> span) =>
 564855            IndexOfAnyAsciiSearcher.LastIndexOfAny<IndexOfAnyAsciiSearcher.Negate>(
 564856                ref MemoryMarshal.GetReference(span), span.Length, ref _state);
 57
 58        [CompExactlyDependsOn(typeof(Ssse3))]
 59        [CompExactlyDependsOn(typeof(AdvSimd))]
 60        [CompExactlyDependsOn(typeof(PackedSimd))]
 61        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 62        internal override bool ContainsAny(ReadOnlySpan<byte> span) =>
 282463            IndexOfAnyAsciiSearcher.ContainsAny<IndexOfAnyAsciiSearcher.DontNegate>(
 282464                ref MemoryMarshal.GetReference(span), span.Length, ref _state);
 65
 66        [CompExactlyDependsOn(typeof(Ssse3))]
 67        [CompExactlyDependsOn(typeof(AdvSimd))]
 68        [CompExactlyDependsOn(typeof(PackedSimd))]
 69        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 70        internal override bool ContainsAnyExcept(ReadOnlySpan<byte> span) =>
 282471            IndexOfAnyAsciiSearcher.ContainsAny<IndexOfAnyAsciiSearcher.Negate>(
 282472                ref MemoryMarshal.GetReference(span), span.Length, ref _state);
 73    }
 74}
 75