HomePhabricator

Message::inLanguage() shouldn't unstub StubUserLang

Authored by Anomie.

Description

Message::inLanguage() shouldn't unstub StubUserLang

When a string is passed to Message::inLanguage(), it first checks
whether the message's current language's code is equal to the string, to
avoid a call to Language::factory(). But if the message's current
language is an instance of StubUserLang, it's probably less expensive to
just call Language::factory() than it is to unstub.

This also avoids a possible recursion warning from T56193, particularly
if inLanguage() is being used intentionally in an attempt to avoid that
warning.

Change-Id: Ia09adec05cfbb09c09e07c6be1e2d613435664d9