Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2668)

Unified Diff: pkg/compiler/lib/src/util/util.dart

Issue 2112893002: Use unordered map hash on ConstructedConstantValue. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/constants/values.dart ('k') | tests/compiler/dart2js/constant_value_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/util/util.dart
diff --git a/pkg/compiler/lib/src/util/util.dart b/pkg/compiler/lib/src/util/util.dart
index 102ca9e1a021d5f80383ecd92d206943c61f5c5d..d9cc16c4c2e82df1f2c2d27398da36f3c6111c51 100644
--- a/pkg/compiler/lib/src/util/util.dart
+++ b/pkg/compiler/lib/src/util/util.dart
@@ -52,6 +52,16 @@ class Hashing {
return h;
}
+ /// Mix the bits of the hash codes of the unordered key/value from [map] with
+ /// [existing].
+ static int unorderedMapHash(Map map, [int existing = 0]) {
+ int h = 0;
+ for (var key in map.keys) {
+ h ^= objectHash(key, objectHash(map[key]));
+ }
+ return mixHashCodeBits(h, existing);
+ }
+
/// Mix the bits of the key/value hash codes from [map] with [existing].
static int mapHash(Map map, [int existing = 0]) {
int h = existing;
« no previous file with comments | « pkg/compiler/lib/src/constants/values.dart ('k') | tests/compiler/dart2js/constant_value_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698