X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FResidueCount.java;h=4ca4c807e291ce5fbf9e3e10c737823b742c3bc9;hb=45d7b8f24253fa1c49977feedfe8a0f2f7cea85e;hp=047b7e782a9780ab4dac81ad93203debfc4d83df;hpb=6099817bf611097b9db77237cabddcdb63d0ad14;p=jalview.git diff --git a/src/jalview/datamodel/ResidueCount.java b/src/jalview/datamodel/ResidueCount.java index 047b7e7..4ca4c80 100644 --- a/src/jalview/datamodel/ResidueCount.java +++ b/src/jalview/datamodel/ResidueCount.java @@ -72,7 +72,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 @@ -232,7 +232,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; } @@ -321,15 +326,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; }