File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
Ramstack.Structures/Collections Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 11# Ramstack.Structures
22
3- Ramstack.Structures is a .NET library providing various data structures and utilities.
3+ [ ![ NuGet] ( https://img.shields.io/nuget/v/Ramstack.Structures.svg )] ( https://nuget.org/packages/Ramstack.Structures )
4+ [ ![ MIT] ( https://img.shields.io/github/license/rameel/ramstack.structures )] ( https://github.com/rameel/ramstack.structures/blob/main/LICENSE )
45
5- [ ![ .NET ] ( https://github.com/rameel/ramstack. structures/actions/workflows/test.yml/badge.svg )] ( https://github.com/rameel/ramstack.structures/actions/workflows/test.yml )
6+ Ramstack.Structures is a .NET library providing various data structures and utilities.
67
78## Installation
89
@@ -47,14 +48,20 @@ foreach (ref readonly HeavyStruct s in view)
4748```
4849## Changelog
4950
51+ ### 1.2.2
52+ - Optimize ` ArrayView.Create ` method for empty collection expression
53+
54+ ### 1.2.1
55+ - Add ` List<T> ` to ` ArrayView<T> ` extension for NET9.0+
56+
5057### 1.2.0
5158- Add ` Trim ` overloads to ` StringView ` class
5259
5360## Supported versions
5461
55- | | Version |
56- | ------| ---------|
57- | .NET | 6, 7, 8 |
62+ | | Version |
63+ | ------| ------------ |
64+ | .NET | 6, 7, 8, 9 |
5865
5966## Contributions
6067
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ public static ArrayView<T> Create<T>(params T[] items) =>
2929 /// <returns>
3030 /// An <see cref="ArrayView{T}"/> instance for the specified read-only span.
3131 /// </returns>
32- public static ArrayView < T > Create < T > ( ReadOnlySpan < T > items ) =>
33- new ( items . ToArray ( ) ) ;
32+ public static ArrayView < T > Create < T > ( params ReadOnlySpan < T > items ) =>
33+ items . Length != 0
34+ ? new ArrayView < T > ( items . ToArray ( ) )
35+ : ArrayView < T > . Empty ;
3436}
You can’t perform that action at this time.
0 commit comments