Page MenuHomePhabricator

[FormatManager] Move Language lookup into the obviously non-cached part (NFC)
ClosedPublic

Authored by aprantl on Dec 10 2019, 10:57 AM.

Details

Summary

This refactoring makes the lookup caching easier to reason about. This has no observable effect although it does slightly change what is being cached.

Before this patch a negative lookup in the LanguageCategory would be cached, but a positive wouldn't.
After this patch LanguageCategory lookups aren't cached, period.

Diff Detail

Event Timeline

Actually, it's worse, LanguageCategory::Get does its own caching.

and again.. it passes in a ValueObject, so it shouldn't be caching.

jingham accepted this revision.Dec 10 2019, 11:58 AM

This seems reasonable.

This revision is now accepted and ready to land.Dec 10 2019, 11:58 AM

@davide said he's working on a patch that turns the ValueObject parameter into a Language. With that in place the caching it does is sound again.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2019, 3:59 PM