Skip to content
Permalink
Browse files
Use Math.min instead of manual calculations.
  • Loading branch information
arturobernalg authored and kinow committed Feb 2, 2022
1 parent 57531bc commit 1023f2fa0de3cd6d3500b37dfbd648a666144d6c
Showing 4 changed files with 5 additions and 6 deletions.
@@ -127,6 +127,9 @@
<name>Todd Carmichael</name>
<email>toddc@concur.com</email>
</contributor>
<contributor>
<name>Arturo Bernal</name>
</contributor>
</contributors>

<dependencies>
@@ -1160,7 +1160,7 @@ public int getMaxTotalPerKey() {
@Override
public int getMinIdlePerKey() {
final int maxIdlePerKeySave = getMaxIdlePerKey();
return this.minIdlePerKey > maxIdlePerKeySave ? maxIdlePerKeySave : minIdlePerKey;
return Math.min(this.minIdlePerKey, maxIdlePerKeySave);
}

@Override
@@ -839,10 +839,7 @@ public int getMaxIdle() {
@Override
public int getMinIdle() {
final int maxIdleSave = getMaxIdle();
if (this.minIdle > maxIdleSave) {
return maxIdleSave;
}
return minIdle;
return Math.min(this.minIdle, maxIdleSave);
}

@Override
@@ -31,7 +31,6 @@

import java.lang.management.ManagementFactory;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.nio.charset.UnsupportedCharsetException;
import java.time.Duration;
import java.time.Instant;

0 comments on commit 1023f2f

Please sign in to comment.