From d32149ae7bed158b10a4f1c327adfb9fdf2e7f47 Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Fri, 31 Aug 2018 10:09:25 -0700 Subject: [PATCH] [SL.Core] Format HashHelpers --- src/SixLabors.Core/Helpers/HashHelpers.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/SixLabors.Core/Helpers/HashHelpers.cs b/src/SixLabors.Core/Helpers/HashHelpers.cs index b1e7ce660..934384238 100644 --- a/src/SixLabors.Core/Helpers/HashHelpers.cs +++ b/src/SixLabors.Core/Helpers/HashHelpers.cs @@ -1,10 +1,12 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using System; + namespace SixLabors { /// - /// Lifted from coreFX repo + /// Provides a set of helpers for combining object hashes. /// internal static class HashHelpers { @@ -16,6 +18,8 @@ namespace SixLabors /// Returns a hash code for the provided hash codes. public static int Combine(int h1, int h2) { + // Lifted from coreFX repo + unchecked { // RyuJIT optimizes this to use the ROL instruction @@ -54,9 +58,8 @@ namespace SixLabors int hash = Combine(h1, h2); hash = Combine(hash, h3); - hash = Combine(hash, h4); - return hash; + return Combine(hash, h4); } } } \ No newline at end of file