diff --git a/samples/ComputeSharp.Sample/Helpers/Formatting.cs b/samples/ComputeSharp.Sample/Helpers/Formatting.cs index ff4a1abb..076512e2 100644 --- a/samples/ComputeSharp.Sample/Helpers/Formatting.cs +++ b/samples/ComputeSharp.Sample/Helpers/Formatting.cs @@ -27,7 +27,7 @@ internal static class Formatting for (int i = 0; i < height; i++) { - float[] row = array.AsSpan(i * width, width).ToArray(); + float[] row = [.. array.AsSpan(i * width, width)]; string text = string.Join(",", row.Select(x => x.ToString(CultureInfo.InvariantCulture).PadLeft(numberWidth))); Console.WriteLine(text); diff --git a/samples/ComputeSharp.Sample/Program.cs b/samples/ComputeSharp.Sample/Program.cs index b94efbb8..9daa34fe 100644 --- a/samples/ComputeSharp.Sample/Program.cs +++ b/samples/ComputeSharp.Sample/Program.cs @@ -3,7 +3,7 @@ using System.Linq; using ComputeSharp; using ComputeSharp.Sample; -float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray(); +float[] array = [.. Enumerable.Range(1, 100)]; // Create the graphics buffer using ReadWriteBuffer gpuBuffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(array); diff --git a/tests/ComputeSharp.Dxc.NuGet/Program.cs b/tests/ComputeSharp.Dxc.NuGet/Program.cs index 458b60af..dfd5d98f 100644 --- a/tests/ComputeSharp.Dxc.NuGet/Program.cs +++ b/tests/ComputeSharp.Dxc.NuGet/Program.cs @@ -6,7 +6,7 @@ using ComputeSharp.Interop; [assembly: SupportedOSPlatform("windows6.2")] -float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray(); +float[] array = [.. Enumerable.Range(1, 100)]; // Create the graphics buffer using ReadWriteBuffer gpuBuffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(array); diff --git a/tests/ComputeSharp.NuGet/Program.cs b/tests/ComputeSharp.NuGet/Program.cs index 42cc0f11..53c661fa 100644 --- a/tests/ComputeSharp.NuGet/Program.cs +++ b/tests/ComputeSharp.NuGet/Program.cs @@ -5,7 +5,7 @@ using ComputeSharp; [assembly: SupportedOSPlatform("windows6.2")] -float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray(); +float[] array = [.. Enumerable.Range(1, 100)]; // Create the graphics buffer using ReadWriteBuffer gpuBuffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(array); diff --git a/tests/ComputeSharp.Pix.NuGet/Program.cs b/tests/ComputeSharp.Pix.NuGet/Program.cs index 1e2b97b5..a59ddd0c 100644 --- a/tests/ComputeSharp.Pix.NuGet/Program.cs +++ b/tests/ComputeSharp.Pix.NuGet/Program.cs @@ -5,7 +5,7 @@ using ComputeSharp; [assembly: SupportedOSPlatform("windows6.2")] -float[] array = Enumerable.Range(1, 100).Select(static i => (float)i).ToArray(); +float[] array = [.. Enumerable.Range(1, 100)]; // Create the graphics buffer using ReadWriteBuffer gpuBuffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(array); diff --git a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs index 9b792313..cfb56dd0 100644 --- a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs +++ b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs @@ -1,6 +1,6 @@ using ComputeSharp; -float[] numbers = Enumerable.Range(0, 128).Select(i => (float)i).ToArray(); +float[] numbers = [.. Enumerable.Range(0, 128)]; using GraphicsDevice device = GraphicsDevice.GetDefault(); using ReadWriteBuffer buffer = device.AllocateReadWriteBuffer(numbers);