JAL-1164 regression on JAL-1292 use bitset to mark graphGroup as rendered
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 11 Oct 2013 16:20:08 +0000 (17:20 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 11 Oct 2013 16:22:15 +0000 (17:22 +0100)
src/jalview/viewmodel/AlignmentViewport.java

index dc352f4..dca968e 100644 (file)
@@ -41,6 +41,7 @@ import jalview.workers.ConsensusThread;
 import jalview.workers.StrucConsensusThread;
 
 import java.util.ArrayList;
+import java.util.BitSet;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
@@ -1413,7 +1414,7 @@ public abstract class AlignmentViewport implements AlignViewportI
     int charHeight = getCharHeight();
     if (aa != null)
     {
-      boolean graphgrp[] = null;
+      BitSet graphgrp = new BitSet();
       for (int i = 0; i < aa.length; i++)
       {
         if (aa[i] == null)
@@ -1427,17 +1428,13 @@ public abstract class AlignmentViewport implements AlignViewportI
         }
         if (aa[i].graphGroup > -1)
         {
-          if (graphgrp == null)
-          {
-            graphgrp = new boolean[aa.length];
-          }
-          if (graphgrp[aa[i].graphGroup])
+          if (graphgrp.get(aa[i].graphGroup))
           {
             continue;
           }
           else
           {
-            graphgrp[aa[i].graphGroup] = true;
+            graphgrp.set(aa[i].graphGroup);
           }
         }
         aa[i].height = 0;