From 2c2992b8822b686f7f12022a66aa41f6969d06d0 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 12 Jul 2016 16:36:31 +0100 Subject: [PATCH 1/1] JAL-1381 JAL-2110 efficiency TODO --- src/jalview/analysis/AlignmentUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index 17aab15..37f225c 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -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()); } -- 1.7.10.2