acquireAll method

void acquireAll(
  1. Iterable<CollisionProspect<T>> source
)

Copies all prospects from source into the pool, expanding capacity at most once.

Implementation

void acquireAll(Iterable<CollisionProspect<T>> source) {
  final needed = source is List ? source.length : null;
  if (needed != null && _storage.length < _count + needed) {
    _expand(source.first.a, needed: needed);
  }
  for (final prospect in source) {
    acquire(prospect.a, prospect.b);
  }
}