< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 16
Coverable lines: 16
Total lines: 75
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%
ContainsAny(...)100%110%
ContainsAnyExcept(...)100%110%

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
 016        public AnyByteSearchValues(ReadOnlySpan<byte> values) =>
 017            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) =>
 024            _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) =>
 031            IndexOfAnyAsciiSearcher.IndexOfAny<IndexOfAnyAsciiSearcher.DontNegate>(
 032                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) =>
 039            IndexOfAnyAsciiSearcher.IndexOfAny<IndexOfAnyAsciiSearcher.Negate>(
 040                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) =>
 047            IndexOfAnyAsciiSearcher.LastIndexOfAny<IndexOfAnyAsciiSearcher.DontNegate>(
 048                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) =>
 055            IndexOfAnyAsciiSearcher.LastIndexOfAny<IndexOfAnyAsciiSearcher.Negate>(
 056                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) =>
 063            IndexOfAnyAsciiSearcher.ContainsAny<IndexOfAnyAsciiSearcher.DontNegate>(
 064                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) =>
 071            IndexOfAnyAsciiSearcher.ContainsAny<IndexOfAnyAsciiSearcher.Negate>(
 072                ref MemoryMarshal.GetReference(span), span.Length, ref _state);
 73    }
 74}
 75