projectionAddRetainedListHostBytes function

int projectionAddRetainedListHostBytes(
  1. int retained,
  2. int length
)

Implementation

int projectionAddRetainedListHostBytes(int retained, int length) {
  if (length < 0 ||
      length > _maxSafeRetainedBytes ~/ projectionRetainedListItemHostBytes) {
    throw acp.ChatInputLimitExceeded(
      resource: 'chat retained state bytes',
      limit: _maxSafeRetainedBytes,
      observedAtLeast: _maxSafeRetainedBytes + 1,
    );
  }
  retained = projectionCheckedRetainedAdd(
    retained,
    projectionRetainedListHostBytes,
  );
  return projectionCheckedRetainedAdd(
    retained,
    length * projectionRetainedListItemHostBytes,
  );
}