function collectASequenceOfCodePointsFast (char, input, position) {
  const idx = input.indexOf(char, position.position)
  const start = position.position

  if (idx === -1) {
    position.position = input.length
    return input.slice(start)
  }

  position.position = idx
  return input.slice(start, position.position)
}
A faster collectASequenceOfCodePoints that only works when comparing a single character.
@param {string} char
@param {string} input
@param {{ position: number }} position