JAL-2759 Move isVisible to use cursor
authorkiramt <k.mourao@dundee.ac.uk>
Fri, 17 Nov 2017 10:41:02 +0000 (10:41 +0000)
committerkiramt <k.mourao@dundee.ac.uk>
Fri, 17 Nov 2017 10:41:02 +0000 (10:41 +0000)
src/jalview/datamodel/HiddenColumns.java

index 4c3560e..69d2ac4 100644 (file)
@@ -593,18 +593,17 @@ public class HiddenColumns
     {
       LOCK.readLock().lock();
 
-      Iterator<int[]> 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();