Avoid creating line nodes twice in lines-yardstick-spec.coffee

This commit is contained in:
Antonio Scandurra
2016-04-08 16:09:33 +02:00
parent 94d6b6531d
commit afdd8d2b6d

View File

@@ -42,11 +42,12 @@ describe "LinesYardstick", ->
lineNode
mockLineNodesProvider =
lineNodesById: {}
lineIdForScreenRow: (screenRow) ->
editor.screenLineForScreenRow(screenRow).id
lineNodeForScreenRow: (screenRow) ->
buildLineNode(screenRow)
@lineNodesById[@lineIdForScreenRow(screenRow)] ?= buildLineNode(screenRow)
textNodesForScreenRow: (screenRow) ->
lineNode = @lineNodeForScreenRow(screenRow)