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:
Norman Maurer 2016-04-06 21:30:32 +02:00
parent c024dc92d0
commit 7b121c26ae

View File

@ -23,6 +23,8 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import static java.lang.Math.*;
final class PoolChunkList<T> implements PoolChunkListMetric {
private static final Iterator<PoolChunkMetric> EMPTY_METRICS = Collections.<PoolChunkMetric>emptyList().iterator();
private final PoolChunkList<T> nextList;
@ -150,12 +152,12 @@ final class PoolChunkList<T> implements PoolChunkListMetric {
@Override
public int minUsage() {
return minUsage == Integer.MIN_VALUE ? 1 : minUsage;
return max(1, minUsage);
}
@Override
public int maxUsage() {
return maxUsage == Integer.MAX_VALUE ? 100 : maxUsage;
return min(maxUsage, 100);
}
@Override