diff --git a/appveyor.yml b/appveyor.yml index f784ef287..9b1ce2b95 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 1.0.0.{build} -image: Visual Studio 2017 +image: Visual Studio 2017 Preview # prevent the double build when a branch has an active PR skip_branch_with_pr: true diff --git a/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs b/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs index 14af8ca6a..97e16ef23 100644 --- a/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs @@ -3,7 +3,6 @@ using System; using System.Runtime.CompilerServices; -using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Formats.Png.Filters { @@ -25,7 +24,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Filters // Insert a byte before the data. result[0] = 0; result = result.Slice(1); - SpanHelper.Copy(scanline, result); + scanline.Slice(0, Math.Min(scanline.Length, result.Length)).CopyTo(result); } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Memory/SpanHelper.cs b/src/ImageSharp/Memory/SpanHelper.cs deleted file mode 100644 index 592e2a885..000000000 --- a/src/ImageSharp/Memory/SpanHelper.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -using System; -using System.Runtime.CompilerServices; - -namespace SixLabors.ImageSharp.Memory -{ - /// - /// Utility methods for - /// - internal static class SpanHelper - { - /// - /// Copy all elements of 'source' into 'destination'. - /// - /// The element type. - /// The to copy elements from. - /// The destination . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Copy(ReadOnlySpan source, Span destination) - where T : struct - { - source.Slice(0, Math.Min(source.Length, destination.Length)).CopyTo(destination); - } - - /// - /// Gets the size of `count` elements in bytes. - /// - /// The element type. - /// The count of the elements - /// The size in bytes as int - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int SizeOf(int count) - where T : struct => Unsafe.SizeOf() * count; - - /// - /// Gets the size of `count` elements in bytes as UInt32 - /// - /// The element type. - /// The count of the elements - /// The size in bytes as UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static uint USizeOf(int count) - where T : struct - => (uint)SizeOf(count); - } -} \ No newline at end of file