summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Florian <mflorian@gitlab.com>2019-05-17 11:29:38 +0800
committerMark Florian <mflorian@gitlab.com>2019-05-17 11:29:40 +0800
commit50910d501f14169f4860ffcc0979e262bb76b8f8 (patch)
treef19be63a7e7b80586763a1d707553d037208e301
parente9ed028472747422670fed448624bb3e067fb4e2 (diff)
downloadgitlab-ce-remove-unnecessary-bind-in-gettext.tar.gz
Remove unnecessary bind callremove-unnecessary-bind-in-gettext
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.
-rw-r--r--app/assets/javascripts/locale/index.js2
1 files changed, 1 insertions, 1 deletions
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