add AggressiveInlining

This commit is contained in:
ikpil 2023-07-26 00:00:09 +09:00
parent 336ba6b132
commit f9c79c9b71
1 changed files with 4 additions and 0 deletions

View File

@ -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);