X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FResidueCount.java;h=dc98f998c1739f35a93b6cddbb51b5485ba1ba82;hb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;hp=74eb8873b168925b6da31485fe4af39d066f9a90;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/datamodel/ResidueCount.java b/src/jalview/datamodel/ResidueCount.java index 74eb887..dc98f99 100644 --- a/src/jalview/datamodel/ResidueCount.java +++ b/src/jalview/datamodel/ResidueCount.java @@ -70,7 +70,7 @@ public class ResidueCount */ private static final String AAS = "ACDEFGHIKLMNPQRSTUVWXY"; - private static final int GAP_COUNT = 0; + static final int GAP_COUNT = 0; /* * fast lookup tables holding the index into our count @@ -212,7 +212,12 @@ public class ResidueCount counts[offset] = (short) ++newValue; } } - maxCount = Math.max(maxCount, newValue); + + if (offset != GAP_COUNT) + { + // update modal residue count + maxCount = Math.max(maxCount, newValue); + } return newValue; } @@ -301,15 +306,7 @@ public class ResidueCount */ public int addGap() { - int newValue; - if (useIntCounts) - { - newValue = ++intCounts[GAP_COUNT]; - } - else - { - newValue = ++counts[GAP_COUNT]; - } + int newValue = increment(GAP_COUNT); return newValue; }