JAL-1381 JAL-2110 efficiency TODO
authorJim Procter <jprocter@issues.jalview.org>
Tue, 12 Jul 2016 15:36:31 +0000 (16:36 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 12 Jul 2016 15:36:31 +0000 (16:36 +0100)
src/jalview/analysis/AlignmentUtils.java

index 17aab15..37f225c 100644 (file)
@@ -2558,7 +2558,8 @@ public class AlignmentUtils
       if (!unmapped.contains(seq))
       {
         char[] newSeq = new char[width];
-        Arrays.fill(newSeq, gap);
+        Arrays.fill(newSeq, gap); // JBPComment - doubt this is faster than the
+                                  // Integer iteration below
         int newCol = 0;
         int lastCol = 0;
 
@@ -2590,6 +2591,7 @@ public class AlignmentUtils
           System.arraycopy(newSeq, 0, tmp, 0, lastCol + 1);
           newSeq = tmp;
         }
+        // TODO: optimise SequenceI to avoid char[]->String->char[]
         seq.setSequence(String.valueOf(newSeq));
         realignedCount++;
       }
@@ -2639,6 +2641,8 @@ public class AlignmentUtils
     {
       SequenceI alignedSequence = alignedDatasets.get(seq
               .getDatasetSequence());
+      // TODO: getSequenceAsString() will be deprecated in the future
+      // TODO: need to leave to SequenceI implementor to update gaps
       seq.setSequence(alignedSequence.getSequenceAsString());
     }