From f7d29eea0f2adcc876f2c748b743b6a2470e3689 Mon Sep 17 00:00:00 2001 From: Geo Perez Date: Tue, 28 Aug 2018 16:20:49 -0500 Subject: [PATCH] Revert --- src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs b/src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs index cd6207564..10a3602d2 100644 --- a/src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs +++ b/src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs @@ -19,7 +19,7 @@ public static class ValueTypeExtensions /// The minimum. /// The maximum. /// A value that indicates the relative order of the objects being compared. - public static T Clamp(this T value, in T min, in T max) + public static T Clamp(this T value, T min, T max) where T : struct, IComparable { if (value.CompareTo(min) < 0) return min; @@ -34,7 +34,7 @@ public static T Clamp(this T value, in T min, in T max) /// The minimum. /// The maximum. /// A value that indicates the relative order of the objects being compared. - public static int Clamp(this int value, in int min, in int max) + public static int Clamp(this int value, int min, int max) => value < min ? min : (value > max ? max : value); ///