Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Avoid silent truncating conversions (issue 3841).
Browse files Browse the repository at this point in the history
  • Loading branch information
Clement Courbet committed May 14, 2015
1 parent 8e5df2b commit 0109acf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/time.d
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,7 @@ struct TickDuration
if(op == "*" &&
(__traits(isIntegral, T) || __traits(isFloating, T)))
{
length *= value;
length = cast(long)(length * value);
}

unittest
Expand Down Expand Up @@ -3434,7 +3434,7 @@ struct TickDuration
if(value == 0)
throw new TimeException("Attempted division by 0.");

length /= value;
length = cast(long)(length / value);
}

unittest
Expand Down

0 comments on commit 0109acf

Please sign in to comment.