scanWhile processes bytes in d.data[d.off:] until it receives a scan code not equal to op.
(op int)
| 342 | // scanWhile processes bytes in d.data[d.off:] until it |
| 343 | // receives a scan code not equal to op. |
| 344 | func (d *decodeState) scanWhile(op int) { |
| 345 | s, data, i := &d.scan, d.data, d.off |
| 346 | for i < len(data) { |
| 347 | newOp := s.step(s, data[i]) |
| 348 | i++ |
| 349 | if newOp != op { |
| 350 | d.opcode = newOp |
| 351 | d.off = i |
| 352 | return |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | d.off = len(data) + 1 // mark processed EOF with len+1 |
| 357 | d.opcode = d.scan.eof() |
| 358 | } |
| 359 | |
| 360 | // value consumes a JSON value from d.data[d.off-1:], decoding into v, and |
| 361 | // reads the following byte ahead. If v is invalid, the value is discarded. |
no test coverage detected