From f7a7a1b85e3ab978220c8ccc924f3356c2a0e523 Mon Sep 17 00:00:00 2001 From: kiramt Date: Fri, 17 Nov 2017 10:41:02 +0000 Subject: [PATCH] JAL-2759 Move isVisible to use cursor --- src/jalview/datamodel/HiddenColumns.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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(); -- 1.7.10.2