Normally there shouldn't be more than one Language object in existence at a time because of $mLangObjCache, so there's no need for a MapCacheLRU for grammar transformations. Just make it an instance member of Language. If someone directly called the Language constructor instead of factory(), or meddled with $mLangObjCache, with one of the three languages that have transforms defined, and called getGrammarTransformations() on both distinct objects, this change could result in duplication of an array of about 50 elements. I think the risk is acceptable. The change should be covered acceptably by existing tests for LanguageHe and LanguageRu. (There's not much to test.) Bug: T201405 Change-Id: I483bafbbb7d109b670596f16381def9e3bd26d89 |
||
|---|---|---|
| .. | ||
| classes | ||
| LanguageClassesTestCase.php | ||
| LanguageConverterTest.php | ||
| LanguageFallbackStaticMethodsTest.php | ||
| LanguageTest.php | ||