X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FMapList.java;h=58abdc3926c1bf1badddf8e83e4b0724c06b30da;hb=refs%2Fheads%2Freleases%2FRelease_2_10_0_Branch;hp=dc5bee876134fee1ea42afc4a767a51c90fe893f;hpb=548b74f9ea6cbcfedc14bf3173d55743c7dccd54;p=jalview.git diff --git a/src/jalview/util/MapList.java b/src/jalview/util/MapList.java index dc5bee8..58abdc3 100644 --- a/src/jalview/util/MapList.java +++ b/src/jalview/util/MapList.java @@ -342,7 +342,8 @@ public class MapList */ public static List coalesceRanges(final List ranges) { - if (ranges == null || ranges.size() < 2) { + if (ranges == null || ranges.size() < 2) + { return ranges; } @@ -353,7 +354,7 @@ public class MapList lastRange = new int[] { lastRange[0], lastRange[1] }; merged.add(lastRange); boolean first = true; - + for (final int[] range : ranges) { if (first) @@ -387,7 +388,8 @@ public class MapList * if next range is in the same direction as last and contiguous, * just update the end position of the last range */ - boolean sameDirection = range[1] == range[0] || direction == lastDirection; + boolean sameDirection = range[1] == range[0] + || direction == lastDirection; boolean extending = range[0] == lastRange[1] + lastDirection; boolean overlapping = (lastDirection == 1 && range[0] >= lastRange[0] && range[0] <= lastRange[1]) || (lastDirection == -1 && range[0] <= lastRange[0] && range[0] >= lastRange[1]); @@ -404,7 +406,7 @@ public class MapList lastDirection = (range[1] == range[0]) ? lastDirection : direction; } } - + return changed ? merged : ranges; }