From 4d2917eef62f1d785371212a9c9661240f376eba Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Tue, 11 Dec 2018 18:05:48 -0800 Subject: [PATCH 1/2] Downgrade System.Buffers to 4.4.0 --- src/SixLabors.Core/SixLabors.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SixLabors.Core/SixLabors.Core.csproj b/src/SixLabors.Core/SixLabors.Core.csproj index 7454cc2..7dd934b 100644 --- a/src/SixLabors.Core/SixLabors.Core.csproj +++ b/src/SixLabors.Core/SixLabors.Core.csproj @@ -48,7 +48,7 @@ - + From 6190ef049f7eb673d2f5e74969d9d4dd3e8e6f3b Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Tue, 11 Dec 2018 18:05:58 -0800 Subject: [PATCH 2/2] Remove HashHelpers --- src/SixLabors.Core/Helpers/HashHelpers.cs | 67 ------------------- .../Helpers/HashHelpersTests.cs | 28 -------- 2 files changed, 95 deletions(-) delete mode 100644 src/SixLabors.Core/Helpers/HashHelpers.cs delete mode 100644 tests/SixLabors.Core.Tests/Helpers/HashHelpersTests.cs diff --git a/src/SixLabors.Core/Helpers/HashHelpers.cs b/src/SixLabors.Core/Helpers/HashHelpers.cs deleted file mode 100644 index b624178..0000000 --- a/src/SixLabors.Core/Helpers/HashHelpers.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -using System; - -namespace SixLabors -{ - /// - /// Provides a set of helpers for combining object hashes. - /// - internal static class HashHelpers - { - /// - /// Combines the two specified hash codes. - /// - /// Hash code one - /// Hash code two - /// Returns a hash code for the provided hash codes. - [Obsolete("Use HashCode.Combine instead")] - public static int Combine(int h1, int h2) - { - // Lifted from coreFX repo - unchecked - { - // RyuJIT optimizes this to use the ROL instruction - // Related GitHub pull request: dotnet/coreclr#1830 - uint rol5 = ((uint)h1 << 5) | ((uint)h1 >> 27); - return ((int)rol5 + h1) ^ h2; - } - } - - /// - /// Combines the three specified hash codes. - /// - /// The first - /// Hash code two - /// Hash code three - /// Returns a hash code for the provided hash codes. - [Obsolete("Use HashCode.Combine instead")] - public static int Combine(int h1, int h2, int h3) - { - int hash = Combine(h1, h2); - - hash = Combine(hash, h3); - - return hash; - } - - /// - /// Combines the four specified hash codes. - /// - /// The first - /// Hash code two - /// Hash code three - /// Hash code four - /// Returns a hash code for the provided hash codes. - [Obsolete("Use HashCode.Combine instead")] - public static int Combine(int h1, int h2, int h3, int h4) - { - int hash = Combine(h1, h2); - - hash = Combine(hash, h3); - - return Combine(hash, h4); - } - } -} \ No newline at end of file diff --git a/tests/SixLabors.Core.Tests/Helpers/HashHelpersTests.cs b/tests/SixLabors.Core.Tests/Helpers/HashHelpersTests.cs deleted file mode 100644 index 7091038..0000000 --- a/tests/SixLabors.Core.Tests/Helpers/HashHelpersTests.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -using Xunit; - -namespace SixLabors.Tests.Helpers -{ - public class HashHelpersTests - { - [Fact] - public void CanCombineTwoValues() - { - Assert.Equal(35, HashHelpers.Combine(1, 2)); - } - - [Fact] - public void CanCombineThreeValues() - { - Assert.Equal(1152, HashHelpers.Combine(1, 2, 3)); - } - - [Fact] - public void CanCombineFourValues() - { - Assert.Equal(38020, HashHelpers.Combine(1, 2, 3, 4)); - } - } -} \ No newline at end of file