Misc Decimal optimizations
authorPent Ploompuu <kaalikas@gmail.com>
Wed, 22 Nov 2017 23:42:37 +0000 (01:42 +0200)
committerJan Kotas <jkotas@microsoft.com>
Wed, 17 Jan 2018 02:39:02 +0000 (18:39 -0800)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
src/mscorlib/shared/System/Math.cs

index 51f6c70..a175103 100644 (file)
@@ -96,7 +96,7 @@ namespace System
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static decimal Abs(decimal value)
         {
-            return decimal.Abs(value);
+            return decimal.Abs(ref value);
         }
 
         [StackTraceHidden]
@@ -453,7 +453,7 @@ namespace System
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static decimal Max(decimal val1, decimal val2)
         {
-            return decimal.Max(val1, val2);
+            return decimal.Max(ref val1, ref val2);
         }
 
         public static double Max(double val1, double val2)
@@ -541,7 +541,7 @@ namespace System
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static decimal Min(decimal val1, decimal val2)
         {
-            return decimal.Min(val1, val2);
+            return decimal.Min(ref val1, ref val2);
         }
 
         public static double Min(double val1, double val2)