diff --git a/src/java/com/samskivert/util/CountMap.java b/src/java/com/samskivert/util/CountMap.java index 6ba351ed..07c70489 100644 --- a/src/java/com/samskivert/util/CountMap.java +++ b/src/java/com/samskivert/util/CountMap.java @@ -52,14 +52,14 @@ public class CountMap extends AbstractMap } /** - * Add the specified amount to the count for the specified key. + * Add the specified amount to the count for the specified key, return the new count. */ public int add (K key, int amount) { CountEntry entry = _backing.get(key); if (entry == null) { _backing.put(key, entry = new CountEntry(key, amount)); - return 0; + return amount; } return (entry.count += amount); }