public Counter <T> Add(T obj, long countValue) { if (!map.TryGetValue(obj, out RWLong count)) { map[obj] = count = new RWLong(); } count.value += countValue; return(this); }
public Counter <T> Add(T obj, long countValue) { RWLong count = map.Get(obj); if (count == null) { map[obj] = count = new RWLong(); } count.value += countValue; return(this); }
public Entry(RWLong count, T value, int uniqueness) { this.count = count; this.value = value; this.uniqueness = uniqueness; }
public long Get(T obj) { RWLong count = map.Get(obj); return(count == null ? 0 : count.value); }