未验证 提交 85a8ac42 编写于 作者: D Dan Field 提交者: GitHub

Make internal cache vars private (#15699)

上级 005d713f
......@@ -483,8 +483,8 @@ class Locale {
@override
int get hashCode => hashValues(languageCode, scriptCode, countryCode);
static Locale cachedLocale;
static String cachedLocaleString;
static Locale _cachedLocale;
static String _cachedLocaleString;
/// Returns a string representing the locale.
///
......@@ -493,11 +493,11 @@ class Locale {
/// purposes only. For parseable results, use [toLanguageTag] instead.
@override
String toString() {
if (!identical(cachedLocale, this)) {
cachedLocale = this;
cachedLocaleString = _rawToString('_');
if (!identical(_cachedLocale, this)) {
_cachedLocale = this;
_cachedLocaleString = _rawToString('_');
}
return cachedLocaleString;
return _cachedLocaleString;
}
/// Returns a syntactically valid Unicode BCP47 Locale Identifier.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册