From b4e972da035e1de36c154da396c06de11960501a Mon Sep 17 00:00:00 2001 From: Laszlo Hornyak Date: Wed, 23 Oct 2013 19:33:48 +0200 Subject: [PATCH] Integer instantation removed Two Integer object was created for each comparison, just in order to compare the two values. This is replaced with Integer.compare() Signed-off-by: Laszlo Hornyak --- .../engine/subsystem/api/storage/StrategyPriority.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java index 81034b1663f..e930d103d11 100644 --- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java +++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java @@ -57,7 +57,7 @@ public class StrategyPriority { public int compare(SnapshotStrategy o1, SnapshotStrategy o2) { int i1 = o1.canHandle(snapshot).ordinal(); int i2 = o2.canHandle(snapshot).ordinal(); - return new Integer(i2).compareTo(new Integer(i1)); + return Integer.compare(i2, i1); } } @@ -74,7 +74,7 @@ public class StrategyPriority { public int compare(DataMotionStrategy o1, DataMotionStrategy o2) { int i1 = o1.canHandle(srcData, destData).ordinal(); int i2 = o2.canHandle(srcData, destData).ordinal(); - return new Integer(i2).compareTo(new Integer(i1)); + return Integer.compare(i2, i1); } } @@ -93,7 +93,7 @@ public class StrategyPriority { public int compare(DataMotionStrategy o1, DataMotionStrategy o2) { int i1 = o1.canHandle(volumeMap, srcHost, destHost).ordinal(); int i2 = o2.canHandle(volumeMap, srcHost, destHost).ordinal(); - return new Integer(i2).compareTo(new Integer(i1)); + return Integer.compare(i2, i1); } } }