From 1f52f4f1522c4bc7c24fb19ba66aeaff3bf15b64 Mon Sep 17 00:00:00 2001 From: Nathan Dinsmore Date: Wed, 17 Jun 2015 18:50:56 -0400 Subject: [PATCH] Optimize StringMorph::clearSelection() This was taking a very large chunk of CPU time when copying large scripts. --- morphic.js | 1 + 1 file changed, 1 insertion(+) diff --git a/morphic.js b/morphic.js index aca37ede..737e944d 100644 --- a/morphic.js +++ b/morphic.js @@ -7402,6 +7402,7 @@ StringMorph.prototype.selectionStartSlot = function () { }; StringMorph.prototype.clearSelection = function () { + if (!this.currentlySelecting && this.startMark === 0 && this.endMark === 0) return; this.currentlySelecting = false; this.startMark = 0; this.endMark = 0;