1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-10 02:25:41 +00:00

Aggressively inline LerpInternal

This commit is contained in:
Oliver Booth 2021-03-11 16:15:57 +00:00
parent f6b885b46b
commit 8976993cee

View File

@ -135,12 +135,12 @@ namespace X10D.DoubleExtensions
return Math.Round(value / nearest) * nearest; return Math.Round(value / nearest) * nearest;
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static double LerpInternal(double a, double b, double t) private static double LerpInternal(double a, double b, double t)
{ {
// rookie mistake: a + t * (b - a) // rookie mistake: a + t * (b - a)
// "precise" method: (1 - t) * a + t * b // "precise" method: (1 - t) * a + t * b
return (1 - t) * a + t * b; return (1.0 - t) * a + t * b;
} }
} }
} }