Use Math.min(...) and Math.max(...) as these are intrinsics.
Motivation:
We should better use Math utilities as these are intrinsics. This is a cleanup for ea3ffb8536
.
Modifications:
Use Math utilities.
Result:
Cleaner code and use of intrinsics.
This commit is contained in:
parent
8bdf73edea
commit
560e0946b3
@ -23,6 +23,8 @@ import java.util.Collections;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static java.lang.Math.*;
|
||||||
|
|
||||||
final class PoolChunkList<T> implements PoolChunkListMetric {
|
final class PoolChunkList<T> implements PoolChunkListMetric {
|
||||||
private static final Iterator<PoolChunkMetric> EMPTY_METRICS = Collections.<PoolChunkMetric>emptyList().iterator();
|
private static final Iterator<PoolChunkMetric> EMPTY_METRICS = Collections.<PoolChunkMetric>emptyList().iterator();
|
||||||
private final PoolChunkList<T> nextList;
|
private final PoolChunkList<T> nextList;
|
||||||
@ -150,12 +152,12 @@ final class PoolChunkList<T> implements PoolChunkListMetric {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int minUsage() {
|
public int minUsage() {
|
||||||
return minUsage == Integer.MIN_VALUE ? 1 : minUsage;
|
return max(1, minUsage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int maxUsage() {
|
public int maxUsage() {
|
||||||
return maxUsage == Integer.MAX_VALUE ? 100 : maxUsage;
|
return min(maxUsage, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user