checkMaxSize static method

void checkMaxSize(
  1. int maxSize, [
  2. String name = 'maxSize'
])

Throws an ArgumentError if maxSize is not a valid maxSize (>= 1): for an adapter to reject it when constructed, before opening a connection for its cache.

Implementation

@pragma('vm:prefer-inline')
static void checkMaxSize(int maxSize, [String name = 'maxSize']) {
  if (maxSize < 1) {
    throw ArgumentError.value(maxSize, name, 'must be >= 1');
  }
}