From f299d6b2fc71975697ea7704bd3a90f835ca9a60 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 10 Feb 2015 14:56:36 +0000 Subject: [PATCH] JAL-1382 @mungo TODO done: use StringUtils for delete chars --- src/jalview/datamodel/Sequence.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 963a7cf..fb559eb 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -21,6 +21,7 @@ package jalview.datamodel; import jalview.analysis.AlignSeq; +import jalview.util.StringUtils; import java.util.ArrayList; import java.util.Enumeration; @@ -725,22 +726,8 @@ public class Sequence implements SequenceI { return; } - // TODO use StringUtils.deleteChars - char[] tmp; - - if (j >= sequence.length) - { - tmp = new char[i]; - System.arraycopy(sequence, 0, tmp, 0, i); - j = sequence.length; - } - else - { - tmp = new char[sequence.length - j + i]; - System.arraycopy(sequence, 0, tmp, 0, i); - System.arraycopy(sequence, j, tmp, i, sequence.length - j); - } + char[] tmp = StringUtils.deleteChars(sequence, i, j); boolean createNewDs = false; // TODO: take a look at the new dataset creation validation method below - // this could become time comsuming for large sequences - consider making it -- 1.7.10.2