diff --git a/src/hotspot/share/gc/g1/g1CollectionSet.cpp b/src/hotspot/share/gc/g1/g1CollectionSet.cpp
index f77a16d7a7e..c6fb67af679 100644
--- a/src/hotspot/share/gc/g1/g1CollectionSet.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectionSet.cpp
@@ -458,13 +458,7 @@ double G1CollectionSet::finalize_young_part(double target_pause_time_ms, G1Survi
}
static int compare_region_idx(const uint a, const uint b) {
- if (a > b) {
- return 1;
- } else if (a == b) {
- return 0;
- } else {
- return -1;
- }
+ return a-b;
}
index f77a16d7a7e..c6fb67af679 100644
--- a/src/hotspot/share/gc/g1/g1CollectionSet.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectionSet.cpp
@@ -458,13 +458,7 @@ double G1CollectionSet::finalize_young_part(double target_pause_time_ms, G1Survi
}
static int compare_region_idx(const uint a, const uint b) {
- if (a > b) {
- return 1;
- } else if (a == b) {
- return 0;
- } else {
- return -1;
- }
+ return a-b;
}