Make internal cache vars private (flutter/engine#15699)
This commit is contained in:
@@ -483,8 +483,8 @@ class Locale {
|
|||||||
@override
|
@override
|
||||||
int get hashCode => hashValues(languageCode, scriptCode, countryCode);
|
int get hashCode => hashValues(languageCode, scriptCode, countryCode);
|
||||||
|
|
||||||
static Locale cachedLocale;
|
static Locale _cachedLocale;
|
||||||
static String cachedLocaleString;
|
static String _cachedLocaleString;
|
||||||
|
|
||||||
/// Returns a string representing the locale.
|
/// Returns a string representing the locale.
|
||||||
///
|
///
|
||||||
@@ -493,11 +493,11 @@ class Locale {
|
|||||||
/// purposes only. For parseable results, use [toLanguageTag] instead.
|
/// purposes only. For parseable results, use [toLanguageTag] instead.
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
if (!identical(cachedLocale, this)) {
|
if (!identical(_cachedLocale, this)) {
|
||||||
cachedLocale = this;
|
_cachedLocale = this;
|
||||||
cachedLocaleString = _rawToString('_');
|
_cachedLocaleString = _rawToString('_');
|
||||||
}
|
}
|
||||||
return cachedLocaleString;
|
return _cachedLocaleString;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a syntactically valid Unicode BCP47 Locale Identifier.
|
/// Returns a syntactically valid Unicode BCP47 Locale Identifier.
|
||||||
|
|||||||
Reference in New Issue
Block a user