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

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

Issue 2392943003: Handle const constructor invocation in kernel_impact. (Closed)
Patch Set: Created 4 years, 2 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
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 397bd6c1cca7fa32b54e78b9aeda3dacf17b8b9f..dbcc7d3a432f5baefd5941f2667ab290345232e8 100644
--- a/pkg/compiler/lib/src/util/util.dart
+++ b/pkg/compiler/lib/src/util/util.dart
@@ -42,6 +42,14 @@ class Hashing {
return mixHashCodeBits(existing, object.hashCode);
}
+ /// Mix the bits of `.hashCode` all non-null objects.
+ static int objectsHash(Object obj1, [Object obj2, Object obj3]) {
+ int hash = 0;
+ if (obj3 != null) hash = objectHash(obj3, hash);
+ if (obj2 != null) hash = objectHash(obj2, hash);
+ return objectHash(obj1, hash);
+ }
+
/// Mix the bits of the element hash codes of [list] with [existing].
static int listHash(List list, [int existing = 0]) {
int h = existing;

Powered by Google App Engine
This is Rietveld 408576698