From 04f2eeb9ec0c4c12df05087bee78d9c7c16b725d Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 30 Jul 2019 18:45:21 +0100 Subject: [PATCH] JAL-3198 more efficient Sequence.getDisplayId() --- src/jalview/datamodel/Sequence.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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(); } -- 1.7.10.2