startsAfterIndent function

bool startsAfterIndent(
  1. String line,
  2. int unit
)

Whether line starts, after up to three spaces, with unit — the cheap test that lets a line-level check skip copying a line that cannot match.

Implementation

bool startsAfterIndent(String line, int unit) {
  final i = firstNonSpace(line);
  return i != -1 && i <= 3 && line.codeUnitAt(i) == unit;
}