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

Unified Diff: runtime/lib/symbol_patch.dart

Issue 2038853003: Specialize Symbol.hashCode (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 | « no previous file | sdk/lib/_internal/js_runtime/lib/internal_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/symbol_patch.dart
diff --git a/runtime/lib/symbol_patch.dart b/runtime/lib/symbol_patch.dart
index fdb652746271d10a1b826814dc0953c5e2d4c8c7..1a1b2bcde7f654a1dcd94a6f50b8903775dacc52 100644
--- a/runtime/lib/symbol_patch.dart
+++ b/runtime/lib/symbol_patch.dart
@@ -51,4 +51,9 @@ patch class Symbol {
}
return result.toString();
}
+
+ /* patch */ int get hashCode {
+ const arbitraryPrime = 664597;
+ return 0x1fffffff & (arbitraryPrime * _name.hashCode);
+ }
}
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/internal_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698