increment method

ScanEntry increment(
  1. String key, [
  2. int by = 1
])

Adds by to the quantity of key, creating the entry if needed.

Implementation

ScanEntry increment(String key, [int by = 1]) {
  if (by < 0) throw ArgumentError.value(by, 'by', 'must not be negative');
  return _setQuantity(ScanOperationKind.increment, key, quantityOf(key) + by);
}