< Summary

Information
Class: System.Buffers.SingleStringSearchValuesFallback<T>
Assembly: System.Private.CoreLib
File(s): D:\runner\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesFallback.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 26
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
IndexOfAnyMultiString(...)0%220%

File(s)

D:\runner\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesFallback.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.Collections.Generic;
 5using System.Globalization;
 6using System.Runtime.CompilerServices;
 7
 8namespace System.Buffers
 9{
 10    internal sealed class SingleStringSearchValuesFallback<TIgnoreCase> : StringSearchValuesBase
 11        where TIgnoreCase : struct, SearchValues.IRuntimeConst
 12    {
 13        private readonly string _value;
 14
 015        public SingleStringSearchValuesFallback(string value, HashSet<string> uniqueValues) : base(uniqueValues)
 16        {
 017            _value = value;
 018        }
 19
 20        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 21        internal override int IndexOfAnyMultiString(ReadOnlySpan<char> span) =>
 022            TIgnoreCase.Value
 023                ? Ordinal.IndexOfOrdinalIgnoreCase(span, _value)
 024                : span.IndexOf(_value);
 25    }
 26}