From: kiramt Date: Fri, 17 Nov 2017 10:41:02 +0000 (+0000) Subject: JAL-2759 Move isVisible to use cursor X-Git-Tag: Release_2_10_4~55^2~1^2~67 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f7a7a1b85e3ab978220c8ccc924f3356c2a0e523;p=jalview.git JAL-2759 Move isVisible to use cursor --- diff --git a/src/jalview/datamodel/HiddenColumns.java b/src/jalview/datamodel/HiddenColumns.java index 4c3560e..69d2ac4 100644 --- a/src/jalview/datamodel/HiddenColumns.java +++ b/src/jalview/datamodel/HiddenColumns.java @@ -593,18 +593,17 @@ public class HiddenColumns { LOCK.readLock().lock(); - Iterator it = new RegionsIterator(column, column, - hiddenColumns, cursor); - while (it.hasNext()) + int regionindex = cursor.findRegionForColumn(column); + if (regionindex > -1 && regionindex < hiddenColumns.size()) { - int[] region = it.next(); + int[] region = hiddenColumns.get(regionindex); if (column >= region[0] && column <= region[1]) { return false; } } - return true; + } finally { LOCK.readLock().unlock();