summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorOla Aunrønning <olaa@verizonmedia.com>2020-01-03 10:54:21 +0100
committerOla Aunrønning <olaa@verizonmedia.com>2020-01-03 10:54:21 +0100
commit63e9dcaa4f97a537fcf6f7498609c2942cc95236 (patch)
tree1d3f46bc5b3c6f01648cf21e781459b852ffa1ec /controller-api
parentd4f8597e4d159f41639721c201594bf811f5ec8a (diff)
Use Double.compare
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceAllocation.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceAllocation.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceAllocation.java
index 1643d836113..205007978e9 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceAllocation.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceAllocation.java
@@ -54,10 +54,9 @@ public class ResourceAllocation {
if (!(o instanceof ResourceAllocation)) return false;
ResourceAllocation other = (ResourceAllocation) o;
- double epsilon = 0.001;
- return Math.abs(this.cpuCores - other.cpuCores) < epsilon &&
- Math.abs(this.memoryGb - other.memoryGb) < epsilon &&
- Math.abs(this.diskGb - other.diskGb) < epsilon;
+ return Double.compare(this.cpuCores, other.cpuCores) == 0 &&
+ Double.compare(this.memoryGb, other.memoryGb) == 0 &&
+ Double.compare(this.diskGb, other.diskGb) == 0;
}