Skip to content

Commit

Permalink
Make internal cache vars private (flutter#15699)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnfield authored Jan 17, 2020
1 parent 005d713 commit 85a8ac4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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.
Expand Down

0 comments on commit 85a8ac4

Please sign in to comment.