From b3d03d032a91ee6745cb93c09d1004a5384800cb Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 12 Feb 2015 11:16:11 -0700 Subject: [PATCH] :racehorse: Read TextEditor::cursors directly to avoid allocation --- src/text-editor-presenter.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 2be807105..31475e317 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -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