Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Locale class: toLanguageTag(), parse() factory constructor, getters #6481

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4b2c152
Locale class: toLanguageTag(), parse() factory constructor.
hugovdm Sep 27, 2018
9b5585e
Style improvements. Mention Unicode supplementalMetadata.xml in docs.
hugovdm Oct 9, 2018
8784112
Some Lint fixes.
hugovdm Oct 9, 2018
d7b948b
Second round of lint fixes.
hugovdm Oct 9, 2018
92fed85
Third round of lint fixes.
hugovdm Oct 9, 2018
49026de
One stray lint fix.
hugovdm Oct 9, 2018
83902a2
First round of PR review fixes.
hugovdm Oct 10, 2018
2b30a87
PR review fixes: asserts, static method, documentation.
hugovdm Oct 11, 2018
761c842
PR review fixes: stop using a SplayTreeSet. Add _fromComponents.
hugovdm Oct 11, 2018
825b0e9
Drop LocaleParseException.
hugovdm Oct 16, 2018
75ed9b0
Stop using SplayTreeMap too. Improve operator== and hashCode.
hugovdm Oct 23, 2018
3fb5b56
WIP: drop Regex: drop toLanguageTag-specific regexp.
hugovdm Oct 29, 2018
aab141c
Replace all regexp's, except _reSep which is needed for String.split().
hugovdm Oct 29, 2018
d9581c8
Merge branch 'master' into unicodebcp47
hugovdm Oct 30, 2018
44e0939
fixup! Merge branch 'master' into unicodebcp47
hugovdm Oct 30, 2018
5f43846
Make hashMap deterministic by sorting map keys.
hugovdm Oct 30, 2018
b6f9a6c
Sort variants and _extensions in Locale._internal.
hugovdm Oct 30, 2018
e75296b
Remove unnecessary diffs in locale_test.dart for easier review.
hugovdm Oct 30, 2018
f03cf6e
Pass StringBuffer to _extensionsToString, return void.
hugovdm Nov 1, 2018
4b90e4c
Add tryParse. Improve unit test formatting.
hugovdm Nov 2, 2018
1ec498a
Replace inefficient List.removeAt(0) calls by an incrementing index.
hugovdm Nov 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/ui/hash_codes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,18 @@ int hashList(Iterable<Object> arguments) {
}
return _Jenkins.finish(result);
}

/// Combine the [Object.hashCode] values of an arbitrary number of key and value
/// objects from a [Map] into one value. This function will return the same
/// value if given null as if given an empty map.
int hashMap(Map<Object, Object> map) {
int result = 0;
if (map != null) {
final List<Object> keys = map.keys.toList()..sort();
for (Object key in keys) {
result = _Jenkins.combine(result, key);
result = _Jenkins.combine(result, map[key]);
}
}
return _Jenkins.finish(result);
}
Loading