From 50910d501f14169f4860ffcc0979e262bb76b8f8 Mon Sep 17 00:00:00 2001 From: Mark Florian Date: Fri, 17 May 2019 11:29:38 +0800 Subject: Remove unnecessary bind call This was creating, calling and throwing away a brand new bound function on every single call to `gettext`. This is wasteful, as the original function can be called directly in such a way that `this` is bound correctly. --- app/assets/javascripts/locale/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/locale/index.js b/app/assets/javascripts/locale/index.js index 1ae3362c4bc..41aa0f4ddb9 100644 --- a/app/assets/javascripts/locale/index.js +++ b/app/assets/javascripts/locale/index.js @@ -11,7 +11,7 @@ delete window.translations; @param text The text to be translated @returns {String} The translated text */ -const gettext = text => locale.gettext.bind(locale)(ensureSingleLine(text)); +const gettext = text => locale.gettext(ensureSingleLine(text)); /** Translate the text with a number -- cgit v1.2.1