Don't call input::seek_fn unnecessarily
This commit is contained in:
parent
b5d022a70c
commit
d33b074c30
2 changed files with 3 additions and 3 deletions
|
|
@ -64,8 +64,7 @@ const char * SpyReader::read(size_t *bytes_read) {
|
|||
}
|
||||
|
||||
int SpyReader::seek(size_t pos) {
|
||||
if (position != pos)
|
||||
strings_read.push_back("");
|
||||
strings_read.push_back("");
|
||||
position = pos;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ static const char *empty_chunk = "";
|
|||
|
||||
static void ts_lexer_read_next_chunk(TSLexer *lexer) {
|
||||
TSInput input = lexer->input;
|
||||
input.seek_fn(input.data, lexer->current_position);
|
||||
if (lexer->current_position.bytes != lexer->chunk_start + lexer->chunk_size)
|
||||
input.seek_fn(input.data, lexer->current_position);
|
||||
lexer->chunk_start = lexer->current_position.bytes;
|
||||
lexer->chunk = input.read_fn(input.data, &lexer->chunk_size);
|
||||
if (!lexer->chunk_size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue