]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3755 Small code simplification
authorJulien Lancelot <julien.lancelot@gmail.com>
Fri, 19 Apr 2013 10:12:56 +0000 (12:12 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Fri, 19 Apr 2013 10:12:56 +0000 (12:12 +0200)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTracking.java

index 1f9e42330911a644db50ee6ba51b1c559c1cd799..a131eee7848d3b16a7d9151dd3ad2aa4e84da316 100644 (file)
@@ -48,8 +48,9 @@ public class IssueTracking implements BatchExtension {
 
   private static final Comparator<LinePair> LINE_PAIR_COMPARATOR = new Comparator<LinePair>() {
     public int compare(LinePair o1, LinePair o2) {
-      if (o2.weight - o1.weight != 0) {
-        return o2.weight - o1.weight;
+      int weightDiff = o2.weight - o1.weight;
+      if (weightDiff != 0) {
+        return weightDiff;
       } else {
        return Math.abs(o1.lineA -o1.lineB) - Math.abs(o2.lineA - o2.lineB);
       }