Patch #25014

redmine/i18n.rb - languages_lookup class variable is rebuilt every time

Added by Jens Krämer 9 months ago. Updated 8 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:I18n
Target version:3.4.0

Description

the @@languages_lookup variable in redmine/i18n.rb appears to be intended as a cache but is assigned to a new value everytime find_language is called.

Attached patch fixes this by using ||= instead of =.

0001-turns-languages_lookup-into-a-cache-by-using.patch Magnifier (758 Bytes) Jens Krämer, 2017-02-06 11:56

Associated revisions

Revision 16349
Added by Jean-Philippe Lang 8 months ago

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

Patch by Jens Kraemer.

History

#1 Updated by Go MAEDA 9 months ago

  • Target version set to 3.4.0

Since find_language method is called on every request, I think caching values is reasonable.
Setting target version to 3.4.0.

#2 Updated by Jean-Philippe Lang 8 months ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed, thanks for the fix.

Also available in: Atom PDF