nonEmpty static method

void nonEmpty(
  1. List<int> data, {
  2. required String operation,
  3. required String name,
})

Requires data to be non-empty, throws BuError if empty.

Implementation

static void nonEmpty(
  List<int> data, {
  required String operation,
  required String name,
}) {
  if (data.isEmpty) {
    throw CoreErrors.invalidOperationArguments(
      operation,
      name: name,
      reason: 'must not be empty',
    );
  }
}