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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch class Symbol { 5 patch class Symbol {
6 /* patch */ const Symbol(String name) 6 /* patch */ const Symbol(String name)
7 : this._name = name; 7 : this._name = name;
8 8
9 /* patch */ toString() => 'Symbol("${getUnmangledName(this)}")'; 9 /* patch */ toString() => 'Symbol("${getUnmangledName(this)}")';
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 if (!skip) { 45 if (!skip) {
46 result.write(char); 46 result.write(char);
47 } 47 }
48 } 48 }
49 if (add_setter_suffix) { 49 if (add_setter_suffix) {
50 result.write('='); 50 result.write('=');
51 } 51 }
52 return result.toString(); 52 return result.toString();
53 } 53 }
54
55 /* patch */ int get hashCode {
56 const arbitraryPrime = 664597;
57 return 0x1fffffff & (arbitraryPrime * _name.hashCode);
58 }
54 } 59 }
OLDNEW
« 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