[Refactor] Use collection expressions.

This commit is contained in:
2024-05-01 04:39:38 +01:00
parent f7ca79b09e
commit 134ce7041e
667 changed files with 12936 additions and 13750 deletions

View File

@@ -52,13 +52,13 @@ public sealed class ExtentsSByte
List<Tuple<sbyte, sbyte>> _backend;
/// <summary>Initialize an empty list of extents</summary>
public ExtentsSByte() => _backend = new List<Tuple<sbyte, sbyte>>();
public ExtentsSByte() => _backend = [];
/// <summary>Initializes extents with an specific list</summary>
/// <param name="list">List of extents as tuples "start, end"</param>
public ExtentsSByte(IEnumerable<Tuple<sbyte, sbyte>> list)
{
_backend = new List<Tuple<sbyte, sbyte>>();
_backend = [];
// This ensure no overlapping extents are added on creation
foreach(Tuple<sbyte, sbyte> t in list) Add(t.Item1, t.Item2);