fastParse method

  1. @override
bool fastParse(
  1. ParseState state
)
override

Parses input data passively, with minimal consumption of system resources during parsing.

Returns true if parsing was successful; otherwise returns false.

if(!fastParse(state)) {
  state.fail(err, state.pos);
}

Implementation

@override
bool fastParse(ParseState state) {
  final pos = state.pos;
  if (pos + 2 <= state.length) {
    final ch = state.data.getUint16(pos, Endian.little);
    if (ch == c) {
      state.pos += 2;
      ws.fastParse(state);
      return true;
    }
  }

  state.fail(_err, pos);
  state.pos = pos;
  return false;
}