Skip to content

Commit

Permalink
Sonar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmoresena committed Jan 16, 2024
1 parent d8923dc commit c627494
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private abstract class FixedCache : ICStringCache
/// <param name="count">Non-empty entries count.</param>
/// <param name="emptyIndices">Empty caps.</param>
/// <returns>A <see cref="FixedCache"/> instance.</returns>
public static FixedCache Create(Int32 count, IImmutableSet<Int32> emptyIndices)
public static FixedCache CreateFixedCache(Int32 count, IImmutableSet<Int32> emptyIndices)
=> count <= 32 ? new CStringCache(count, emptyIndices) : new WeakCache(count, emptyIndices);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ private static void CreateCStringSequence<TState>(Span<Byte> buffer, SequenceCre
return lengths.Count switch
{
<= 32 => new CString?[count],
<= 256 => FixedCache.Create(count, ImmutableHashSet<Int32>.Empty),
<= 256 => FixedCache.CreateFixedCache(count, ImmutableHashSet<Int32>.Empty),
_ => new DynamicCache(),
};

// Otherwise
return lengths.Count switch
{
<= 256 => FixedCache.Create(count, emptyIndices.SkipLast(skipLast).ToImmutableHashSet()),
<= 256 => FixedCache.CreateFixedCache(count, emptyIndices.SkipLast(skipLast).ToImmutableHashSet()),
_ => new DynamicCache(),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public interface IEnumerableSequence<out T> : IEnumerable<T>
/// <summary>
/// Method to call when <see cref="IEnumerator{T}"/> is disposing.
/// </summary>
protected void DisposeEnumeration() { }
protected void DisposeEnumeration()
{
// By default no resources to dispose.
}

/// <summary>
/// Creates an enumerator that iterates through the sequence.
Expand Down

0 comments on commit c627494

Please sign in to comment.