From 997ca496790a93e5fe429895375446a9e6f4351b Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Fri, 23 Mar 2018 10:03:45 -0700 Subject: [PATCH] Remove unused FetchVector helper This doesn't account for alignment and we're getting a native constructor soon. https://github.com/dotnet/corefx/issues/24343 --- src/ImageSharp/Memory/SpanHelper.cs | 15 --------------- tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/src/ImageSharp/Memory/SpanHelper.cs b/src/ImageSharp/Memory/SpanHelper.cs index 1cfad72228..4a6b7b7ce6 100644 --- a/src/ImageSharp/Memory/SpanHelper.cs +++ b/src/ImageSharp/Memory/SpanHelper.cs @@ -2,9 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; -using System.Numerics; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; namespace SixLabors.ImageSharp.Memory { @@ -13,19 +11,6 @@ namespace SixLabors.ImageSharp.Memory /// internal static class SpanHelper { - /// - /// Fetches a from the beginning of the span. - /// - /// The value type - /// The span to fetch the vector from - /// A reference to the beginning of the span - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ref Vector FetchVector(this Span span) - where T : struct - { - return ref Unsafe.As>(ref MemoryMarshal.GetReference(span)); - } - /// /// Copy 'count' number of elements of the same type from 'source' to 'dest' /// diff --git a/tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs b/tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs index 23bc297436..a813e0c1dd 100644 --- a/tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs +++ b/tests/ImageSharp.Tests/Memory/SpanUtilityTests.cs @@ -26,21 +26,6 @@ namespace SixLabors.ImageSharp.Tests.Memory Assert.True(Unsafe.AreSame(ref a, ref bb), "References are not same!"); } } - - [Fact] - public void FetchVector() - { - float[] stuff = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; - - var span = new Span(stuff); - - ref Vector v = ref span.FetchVector(); - - Assert.Equal(0, v[0]); - Assert.Equal(1, v[1]); - Assert.Equal(2, v[2]); - Assert.Equal(3, v[3]); - } public class SpanHelper_Copy {