combineN method

  1. @override
T combineN(
  1. T a,
  2. int n
)
override

Only apply combine operation the first time:

  • n == 1, then return a
  • Otherwise return combine(a, a)

Implementation

@override
T combineN(T a, int n) {
  if (n <= 0) {
    throw const FormatException(
        "Repeated combining for bands must have n > 0");
  }

  return n == 1 ? a : combine(a, a);
}