From 5152cc0243b3ee298970fb473a8ea65d60897c01 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 25 Oct 2016 10:01:11 +0100 Subject: [PATCH] JAL-98 small efficiency fix + commenting --- src/jalview/analysis/ResidueCount.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/jalview/analysis/ResidueCount.java b/src/jalview/analysis/ResidueCount.java index cd35206..256dbc2 100644 --- a/src/jalview/analysis/ResidueCount.java +++ b/src/jalview/analysis/ResidueCount.java @@ -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) -- 1.7.10.2