@internal
(index: number)
| 919 | |
| 920 | /** @internal */ |
| 921 | _split(index: number): boolean | void { |
| 922 | if (this.byStart[index] || this.byEnd[index]) |
| 923 | return |
| 924 | |
| 925 | if (DEBUG) |
| 926 | this.stats.time('_split') |
| 927 | |
| 928 | let chunk = this.lastSearchedChunk |
| 929 | let previousChunk = chunk |
| 930 | const searchForward = index > chunk.end |
| 931 | |
| 932 | while (chunk) { |
| 933 | if (chunk.contains(index)) |
| 934 | return this._splitChunk(chunk, index) |
| 935 | |
| 936 | chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start] |
| 937 | |
| 938 | // Prevent infinite loop (e.g. via empty chunks, where start === end) |
| 939 | if (chunk === previousChunk) |
| 940 | return |
| 941 | |
| 942 | previousChunk = chunk |
| 943 | } |
| 944 | } |
| 945 | |
| 946 | /** @internal */ |
| 947 | _splitChunk(chunk: Chunk, index: number): true { |
no test coverage detected