checkAvailable method Null safety

void checkAvailable(
  1. int registers
)

Throws CalculatorError(10) if the needed register memory isn't available

Implementation

void checkAvailable(int registers) {
  if (registers > _memory.availableRegisters) {
    throw CalculatorError(10);
  }
}