[hg] main-silver: #231021: stabilized comparator behaviour, stil...

  • From: Svata Dedic < >
  • To:
  • Subject: [hg] main-silver: #231021: stabilized comparator behaviour, stil...
  • Date: Mon, 15 Jul 2013 01:58:55 -0700

changeset 04216246e735 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/04216246e735
description:
        #231021: stabilized comparator behaviour, still sorts primarily 
according to fold start pos

diffstat:

 editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java |  8 
++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (20 lines):

diff --git 
a/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java 
b/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java
--- a/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java
+++ b/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java
@@ -297,12 +297,12 @@
         @Override
         public int compare(Fold a, Fold b) {
             int diff = a.getStartOffset() - b.getStartOffset();
-            if (diff < 0) {
-                return -1;
+            if (diff != 0) {
+                return diff;
             }
             int diff2 = b.getEndOffset() - a.getEndOffset();
-            if (diff2 != 0 || diff != 0) {
-                return 1;
+            if (diff2 != 0) {
+                return diff2;
             }
             ApiPackageAccessor accessor = getAccessor();
             return accessor.foldGetOperation(a).getPriority() - 
accessor.foldGetOperation(b).getPriority();

[hg] main-silver: #231021: stabilized comparator behaviour, stil...

Svata Dedic 07/15/2013

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close