🐎 Read TextEditor::cursors directly to avoid allocation

This commit is contained in:
Nathan Sobo
2015-02-12 11:16:11 -07:00
parent 205d1df7b4
commit b3d03d032a

View File

@@ -206,7 +206,7 @@ class TextEditorPresenter
@state.content.cursors = {}
return unless @hasRequiredMeasurements()
for cursor in @model.getCursors()
for cursor in @model.cursors # using property directly to avoid allocation
if cursor.isVisible() and @startRow <= cursor.getScreenRow() < @endRow
pixelRect = @pixelRectForScreenRange(cursor.getScreenRange())
pixelRect.width = @baseCharacterWidth if pixelRect.width is 0