summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-02 19:42:18 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-02 19:42:18 +0000
commit64b30de7875910390474610923b91b0e9c783287 (patch)
treea2354585815bacfae24066394b658b039eb99c70 /lib
parent125d8e26b6e8c6ee3dd01e6b928dbdef754303db (diff)
downloadredmine-64b30de7875910390474610923b91b0e9c783287.tar.gz
redmine-64b30de7875910390474610923b91b0e9c783287.zip
Turns @@languages_lookup into a cache by using ||= (#25014).
Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@16349 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/i18n.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb
index dfeaf474e..44bad4d06 100644
--- a/lib/redmine/i18n.rb
+++ b/lib/redmine/i18n.rb
@@ -130,7 +130,7 @@ module Redmine
end
def find_language(lang)
- @@languages_lookup = valid_languages.inject({}) {|k, v| k[v.to_s.downcase] = v; k }
+ @@languages_lookup ||= valid_languages.inject({}) {|k, v| k[v.to_s.downcase] = v; k }
@@languages_lookup[lang.to_s.downcase]
end