Skip to content

Commit

Permalink
Change parameter types to const to avoid template bloat.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-timokhin committed Jul 15, 2015
1 parent 87a4b10 commit 54edaa1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion std/math.d
Expand Up @@ -6855,11 +6855,14 @@ real yl2xp1(real x, real y) @nogc @safe pure nothrow; // y * log2(x + 1)
* $(MYREF isIdentical)
* Standards: Conforms to IEEE 754-2008
*/
int cmp(T)(T x, T y) @nogc @trusted pure nothrow
int cmp(T)(const(T) x, const(T) y) @nogc @trusted pure nothrow
if (isFloatingPoint!T)
{
alias F = floatTraits!T;

// mutable parameter counterparts, because they *are* mutated later in code
T mutX = x, mutY = y;

static if (F.realFormat == RealFormat.ieeeSingle
|| F.realFormat == RealFormat.ieeeDouble)
{
Expand Down

0 comments on commit 54edaa1

Please sign in to comment.