From be5974734dab5ecaeef8ed25c681b5c169182906 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 5 Jun 2020 13:37:07 +0100 Subject: [PATCH] PERF: Pass element to resolveAllShortUrl function, not text selector (#9988) We already have a reference to the preview element, so there is no need to look it up again. This saves about 1ms per keypress in my testing. --- .../javascripts/discourse/app/components/composer-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/components/composer-editor.js b/app/assets/javascripts/discourse/app/components/composer-editor.js index 74443c88ec4..e33973cd44c 100644 --- a/app/assets/javascripts/discourse/app/components/composer-editor.js +++ b/app/assets/javascripts/discourse/app/components/composer-editor.js @@ -1000,7 +1000,7 @@ export default Component.extend({ ); // Short upload urls need resolution - resolveAllShortUrls(ajax, this.siteSettings, ".d-editor-preview-wrapper"); + resolveAllShortUrls(ajax, this.siteSettings, $preview[0]); if (this._enableAdvancedEditorPreviewSync()) { this._syncScroll(