From ea80483cbe6e97a668f720f42f9538267bc52d7f Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 12 Oct 2016 12:16:17 +0200 Subject: [PATCH] Delete `TokenizedBuffer.prototype.buildPlaceholderTokenizedLinesForRows` --- src/tokenized-buffer.coffee | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index 20e79d28a..ba40af58a 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -120,7 +120,7 @@ class TokenizedBuffer extends Model tokenizeNextChunk: -> # Short circuit null grammar which can just use the placeholder tokens if @grammar.name is 'Null Grammar' and @firstInvalidRow()? - @tokenizedLines = @buildPlaceholderTokenizedLinesForRows(0, @buffer.getLastRow()) + @tokenizedLines = new Array(@buffer.getLineCount()) @invalidRows = [] @markTokenizationComplete() return @@ -194,7 +194,8 @@ class TokenizedBuffer extends Model @updateInvalidRows(start, end, delta) previousEndStack = @stackForRow(end) # used in spill detection below if @largeFileMode or @grammar.name is 'Null Grammar' - newTokenizedLines = @buildPlaceholderTokenizedLinesForRows(start, end + delta) + lineCount = ((end + delta) - start) + 1 + newTokenizedLines = new Array(lineCount) else newTokenizedLines = @buildTokenizedLinesForRows(start, end + delta, @stackForRow(start - 1), @openScopesForRow(start)) _.spliceWithArray(@tokenizedLines, start, end - start + 1, newTokenizedLines) @@ -253,9 +254,6 @@ class TokenizedBuffer extends Model tokenizedLines - buildPlaceholderTokenizedLinesForRows: (startRow, endRow) -> - new Array(endRow - startRow + 1) - buildTokenizedLineForRow: (row, ruleStack, openScopes) -> @buildTokenizedLineForRowWithText(row, @buffer.lineForRow(row), ruleStack, openScopes)