recordPatternInReverse static method

void recordPatternInReverse(
  1. UBitArray row,
  2. int start,
  3. Int32List counters
)

Implementation

static void recordPatternInReverse(UBitArray row, int start, Int32List counters) {
  int numTransitionsLeft = counters.length;
  bool last = row.get(start);
  int position = start;
  while (position > 0 && numTransitionsLeft >= 0) {
    position--;
    if (row.get(position) != last) {
      numTransitionsLeft--;
      last = !last;
    }
  }
  if (numTransitionsLeft >= 0) throw const UCodeDecodeException("Truncated reverse pattern");
  recordPattern(row, position + 1, counters);
}