diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-02 19:42:18 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-02 19:42:18 +0000 |
commit | 64b30de7875910390474610923b91b0e9c783287 (patch) | |
tree | a2354585815bacfae24066394b658b039eb99c70 /lib | |
parent | 125d8e26b6e8c6ee3dd01e6b928dbdef754303db (diff) | |
download | redmine-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.rb | 2 |
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 |