JAL-98 small efficiency fix + commenting
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 25 Oct 2016 09:01:11 +0000 (10:01 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 25 Oct 2016 09:01:11 +0000 (10:01 +0100)
src/jalview/analysis/ResidueCount.java

index cd35206..256dbc2 100644 (file)
@@ -494,6 +494,11 @@ public class ResidueCount
         }
       }
     }
+
+    /*
+     * include 'other' characters recorded (even if count is zero
+     * though that would be a strange use case)
+     */
     if (otherData != null)
     {
       size += otherData.size();
@@ -510,8 +515,9 @@ public class ResidueCount
    */
   public SymbolCounts getSymbolCounts()
   {
-    char[] symbols = new char[size()];
-    int[] values = new int[size()];
+    int size = size();
+    char[] symbols = new char[size];
+    int[] values = new int[size];
     int j = 0;
 
     if (useIntCounts)