Skip to content
Snippets Groups Projects
Commit 47c2d153 authored by dsehnal's avatar dsehnal
Browse files

tweak readLinesAsync

parent 18be09e9
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,6 @@ namespace Tokenizer {
/** Advance the state by the given number of lines and return line starts/ends as tokens. */
export async function readLinesAsync(state: Tokenizer, count: number, ctx: RuntimeContext, initialLineCount = 100000): Promise<Tokens> {
const { length } = state;
const lineTokens = TokenBuilder.create(state.data, count * 2);
let linesAlreadyRead = 0;
......@@ -143,7 +142,7 @@ namespace Tokenizer {
readLinesChunk(state, linesToRead, lineTokens);
linesAlreadyRead += linesToRead;
return linesToRead;
}, (ctx, state) => ctx.update({ message: 'Parsing...', current: state.position, max: length }));
}, (ctx, state) => ctx.update({ message: 'Parsing...', current: state.position, max: state.length }));
return lineTokens;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment