Commit db3e2e4d authored by jplang's avatar jplang

Turns @@languages_lookup into a cache by using ||= (#25014).

Patch by Jens Kraemer.

git-svn-id: https://svn.redmine.org/redmine/trunk@16349 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent dfd770c8
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment