resize method

Pool resize(
  1. num size
)

@return Self, for chaining

Implementation

Pool resize(num size) {
  final objects = this.objects;

  while (objects.length > size) {
    objects.removeLast();
  }

  while (objects.length < size) {
    objects.add(constructObject());
  }

  return this;
}