public void IncrementRootCount(string root, int count = 1) { if (!RootCounts.ContainsKey(root)) { RootCounts.Add(root, 0); } RootCounts[root] += count; }
public void DecrementRootCount(string root, int count = 1) { if (!RootCounts.ContainsKey(root)) { RootCounts.Add(root, 0); } RootCounts[root] -= count; if (RootCounts[root] < 0) { RootCounts[root] = 0; } }