JAL-3198 more efficient Sequence.getDisplayId()
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 30 Jul 2019 17:45:21 +0000 (18:45 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 30 Jul 2019 17:45:21 +0000 (18:45 +0100)
src/jalview/datamodel/Sequence.java

index 6f5c18a..247f5e5 100755 (executable)
@@ -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();
   }