mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8281259: MutableBigInteger subtraction could be simplified
Reviewed-by: bpb
This commit is contained in:
parent
f399ae558e
commit
e73ee0ca10
2 changed files with 16 additions and 5 deletions
|
@ -207,4 +207,15 @@ public class BigIntegers {
|
|||
bh.consume(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
/** Invokes the gcd method of BigInteger with different values. */
|
||||
@Benchmark
|
||||
@OperationsPerInvocation(TESTSIZE)
|
||||
public void testGcd(Blackhole bh) {
|
||||
for (int i = 0; i < TESTSIZE; i++) {
|
||||
BigInteger i1 = shiftArray[TESTSIZE - i - 1];
|
||||
BigInteger i2 = shiftArray[i];
|
||||
bh.consume(i2.gcd(i1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue