From: gmungoc Date: Tue, 30 Jul 2019 17:45:21 +0000 (+0100) Subject: JAL-3198 more efficient Sequence.getDisplayId() X-Git-Tag: Release_2_11_1_0~28^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=04f2eeb9ec0c4c12df05087bee78d9c7c16b725d;p=jalview.git JAL-3198 more efficient Sequence.getDisplayId() --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 6f5c18a..247f5e5 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -446,18 +446,19 @@ public class Sequence extends ASequence implements SequenceI } /** - * DOCUMENT ME! + * Answers the sequence name, with '/start-end' appended if jvsuffix is true * - * @return DOCUMENT ME! + * @return */ @Override public String getDisplayId(boolean jvsuffix) { - StringBuffer result = new StringBuffer(name); - if (jvsuffix) + if (!jvsuffix) { - result.append("/" + start + "-" + end); + return name; } + StringBuilder result = new StringBuilder(name); + result.append("/").append(start).append("-").append(end); return result.toString(); }