From f9c79c9b7142d3562524fe78d0f94aba7a115c29 Mon Sep 17 00:00:00 2001 From: ikpil Date: Wed, 26 Jul 2023 00:00:09 +0900 Subject: [PATCH] add AggressiveInlining --- src/DotRecast.Core/RcMath.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/DotRecast.Core/RcMath.cs b/src/DotRecast.Core/RcMath.cs index a62e103..474ff54 100644 --- a/src/DotRecast.Core/RcMath.cs +++ b/src/DotRecast.Core/RcMath.cs @@ -19,21 +19,25 @@ freely, subject to the following restrictions: */ using System; +using System.Runtime.CompilerServices; namespace DotRecast.Core { public static class RcMath { + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Sqr(float f) { return f * f; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Clamp(float v, float min, float max) { return Math.Max(Math.Min(v, max), min); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Clamp(int v, int min, int max) { return Math.Max(Math.Min(v, max), min);