< Summary

Information
Class: System.Buffers.AnyByteSearchValues
Assembly: System.Private.CoreLib
File(s): D:\runner\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\AnyByteSearchValues.cs
Line coverage
93%
Covered lines: 15
Uncovered lines: 1
Coverable lines: 16
Total lines: 74
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)

D:\runner\runtime\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
 282916        public AnyByteSearchValues(ReadOnlySpan<byte> values) =>
 282917            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) =>
 44517124            _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) =>
 848731            IndexOfAnyAsciiSearcher.IndexOfAny<IndexOfAnyAsciiSearcher.DontNegate>(
 848732                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) =>
 848739            IndexOfAnyAsciiSearcher.IndexOfAny<IndexOfAnyAsciiSearcher.Negate>(
 848740                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) =>
 565847            IndexOfAnyAsciiSearcher.LastIndexOfAny<IndexOfAnyAsciiSearcher.DontNegate>(
 565848                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) =>
 565855            IndexOfAnyAsciiSearcher.LastIndexOfAny<IndexOfAnyAsciiSearcher.Negate>(
 565856                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) =>
 282963            IndexOfAnyAsciiSearcher.ContainsAny<IndexOfAnyAsciiSearcher.DontNegate>(
 282964                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) =>
 282971            IndexOfAnyAsciiSearcher.ContainsAny<IndexOfAnyAsciiSearcher.Negate>(
 282972                ref MemoryMarshal.GetReference(span), span.Length, ref _state);
 73    }
 74}