Skip to content

Commit b4e972d

Browse files
committed
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 <laszlo.hornyak@gmail.com>
1 parent 7edb4d3 commit b4e972d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public SnapshotStrategyComparator(Snapshot snapshot) {
5757
public int compare(SnapshotStrategy o1, SnapshotStrategy o2) {
5858
int i1 = o1.canHandle(snapshot).ordinal();
5959
int i2 = o2.canHandle(snapshot).ordinal();
60-
return new Integer(i2).compareTo(new Integer(i1));
60+
return Integer.compare(i2, i1);
6161
}
6262
}
6363

@@ -74,7 +74,7 @@ public DataMotionStrategyComparator(DataObject srcData, DataObject destData) {
7474
public int compare(DataMotionStrategy o1, DataMotionStrategy o2) {
7575
int i1 = o1.canHandle(srcData, destData).ordinal();
7676
int i2 = o2.canHandle(srcData, destData).ordinal();
77-
return new Integer(i2).compareTo(new Integer(i1));
77+
return Integer.compare(i2, i1);
7878
}
7979
}
8080

@@ -93,7 +93,7 @@ public DataMotionStrategyHostComparator(Map<VolumeInfo, DataStore> volumeMap, Ho
9393
public int compare(DataMotionStrategy o1, DataMotionStrategy o2) {
9494
int i1 = o1.canHandle(volumeMap, srcHost, destHost).ordinal();
9595
int i2 = o2.canHandle(volumeMap, srcHost, destHost).ordinal();
96-
return new Integer(i2).compareTo(new Integer(i1));
96+
return Integer.compare(i2, i1);
9797
}
9898
}
9999
}

0 commit comments

Comments
 (0)