guardedLength method

int guardedLength(
  1. int declared, {
  2. int cap = uMaxTagAllocation,
})

Implementation

int guardedLength(int declared, {int cap = uMaxTagAllocation}) {
  if (declared < 0) return 0;
  final int limit = cap < remaining ? cap : remaining;
  return declared > limit ? limit : declared;
}