Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 3d4b3d5

Browse files
author
buchholz
committed
Nullcheck is not needed, num2 is checked at the top of the method
1 parent 69a3038 commit 3d4b3d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/javamoney/moneta/FastMoney.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ private long multiplyExact(long num1, long num2) {
477477
long exact = num1 * num2;
478478

479479
// very expensive - this check is only executed in special cases
480-
if( num1 != 0 && exact / num1 != num2 ) {
480+
// zero check is not needed, see above
481+
if( exact / num1 != num2 ) {
481482
throw new ArithmeticException("overflow");
482483
}
483484

0 commit comments

Comments
 (0)