| 76 | } |
| 77 | |
| 78 | func (r *ffReader) ReadByteNoWS() (byte, error) { |
| 79 | if r.i >= r.l { |
| 80 | return 0, io.EOF |
| 81 | } |
| 82 | |
| 83 | j := r.i |
| 84 | |
| 85 | for { |
| 86 | c := r.s[j] |
| 87 | j++ |
| 88 | |
| 89 | // inline whitespace parsing gives another ~8% performance boost |
| 90 | // for many kinds of nicely indented JSON. |
| 91 | // ... and using a [255]bool instead of multiple ifs, gives another 2% |
| 92 | /* |
| 93 | if c != '\t' && |
| 94 | c != '\n' && |
| 95 | c != '\v' && |
| 96 | c != '\f' && |
| 97 | c != '\r' && |
| 98 | c != ' ' { |
| 99 | r.i = j |
| 100 | return c, nil |
| 101 | } |
| 102 | */ |
| 103 | if whitespaceLookupTable[c] == false { |
| 104 | r.i = j |
| 105 | return c, nil |
| 106 | } |
| 107 | |
| 108 | if j >= r.l { |
| 109 | return 0, io.EOF |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | func (r *ffReader) ReadByte() (byte, error) { |
| 115 | if r.i >= r.l { |