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

Commit

Permalink
Merge pull request #1268 from legrosbuffle/explicit-truncating-conver…
Browse files Browse the repository at this point in the history
…sions

Avoid silent truncating conversions (issue 3841).
  • Loading branch information
MartinNowak committed May 14, 2015
2 parents 8e5df2b + 0109acf commit 254c8ee
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 254c8ee

Please sign in to comment.