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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart

Issue 17569004: Implement hashCode on objects stored in a set or used as map keys. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with TOT Created 7 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
Index: dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart b/dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart
index 23b4f7832379d3d728e67d2c41070872890bec0e..fb4a1e0e7d9103af80137d87748042f315bff737 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart
@@ -150,6 +150,8 @@ class Token implements Spannable {
return slowToString().length;
}
}
+
+ int get hashCode => computeHashCode(charOffset, info, value);
}
/**
@@ -312,6 +314,8 @@ class PrecedenceInfo {
const PrecedenceInfo(this.value, this.precedence, this.kind);
toString() => 'PrecedenceInfo($value, $precedence, $kind)';
+
+ int get hashCode => computeHashCode(value, precedence, kind);
}
// TODO(ahe): The following are not tokens in Dart.

Powered by Google App Engine
This is Rietveld 408576698