Avoid named parameter to save an allocation

This commit is contained in:
Antonio Scandurra
2015-03-18 17:44:35 +01:00
parent 8559526215
commit f5e1e40edd
2 changed files with 2 additions and 4 deletions

View File

@@ -1164,7 +1164,7 @@ class DisplayBuffer extends Model
while wrapScreenColumn = tokenizedLine.findWrapColumn(@getSoftWrapColumn())
[wrappedLine, tokenizedLine] = tokenizedLine.softWrapAt(
wrapScreenColumn,
hangingIndent: @configSettings.softWrapHangingIndent
@configSettings.softWrapHangingIndent
)
break if wrappedLine.hasOnlySoftWrapIndentation()
screenLines.push(wrappedLine)

View File

@@ -132,11 +132,9 @@ class TokenizedLine
else
indentTokens
softWrapAt: (column, options = {}) ->
softWrapAt: (column, hangingIndent) ->
return [new TokenizedLine([], '', [0, 0], [0, 0]), this] if column == 0
{hangingIndent} = options
rightTokens = new Array(@tokens...)
leftTokens = []
leftTextLength = 0