summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Dinsmore <nathan@users.noreply.github.com>2015-06-17 18:50:56 -0400
committerNathan Dinsmore <nathan@users.noreply.github.com>2015-06-17 18:52:20 -0400
commit1f52f4f1522c4bc7c24fb19ba66aeaff3bf15b64 (patch)
tree948fc4be3fc7e89a9d0f403d936d838f21a53016
parent94687f8e630c5be6f2c82615c1aa1ec5cbee82b8 (diff)
downloadsnap-1f52f4f1522c4bc7c24fb19ba66aeaff3bf15b64.tar.gz
snap-1f52f4f1522c4bc7c24fb19ba66aeaff3bf15b64.zip
Optimize StringMorph::clearSelection()
This was taking a very large chunk of CPU time when copying large scripts.
-rw-r--r--morphic.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/morphic.js b/morphic.js
index aca37ed..737e944 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;