1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-19 15:38:17 +00:00

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
This commit is contained in:
Jean-Philippe Lang 2017-03-02 19:42:18 +00:00
parent 125d8e26b6
commit 64b30de787

View File

@ -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