mirror of
https://github.com/bitwarden/server
synced 2025-12-10 05:13:48 +00:00
Formatting
This commit is contained in:
@@ -27,7 +27,7 @@ public static class SpanExtensions
|
||||
var count = 0;
|
||||
int pos;
|
||||
|
||||
while((pos = span.IndexOf(value)) >= 0)
|
||||
while ((pos = span.IndexOf(value)) >= 0)
|
||||
{
|
||||
span = span[++pos..];
|
||||
count++;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.Core.Utilities;
|
||||
using Xunit;
|
||||
|
||||
#nullable enable
|
||||
@@ -42,9 +42,9 @@ public class SpanExtensionsTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(new [] {5, 4}, 5, 1)]
|
||||
[InlineData(new [] { 1 }, 5, 0)]
|
||||
[InlineData(new [] { 5, 5, 5}, 5, 3)]
|
||||
[InlineData(new[] { 5, 4 }, 5, 1)]
|
||||
[InlineData(new[] { 1 }, 5, 0)]
|
||||
[InlineData(new[] { 5, 5, 5 }, 5, 3)]
|
||||
public void CountIntegers_ReturnsCount(int[] array, int countNumber, int expectedInstances)
|
||||
{
|
||||
Assert.Equal(expectedInstances, ((ReadOnlySpan<int>)array.AsSpan()).Count(countNumber));
|
||||
|
||||
Reference in New Issue
Block a user