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

Side by Side Diff: lib/coreimpl/hash_map_set.dart

Issue 10910037: - Change "static final" to "static const" in the lib/coreimpl/ directory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « lib/coreimpl/dual_pivot_quicksort.dart ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Hash map implementation with open addressing and quadratic probing. 5 // Hash map implementation with open addressing and quadratic probing.
6 class HashMapImplementation<K extends Hashable, V> implements HashMap<K, V> { 6 class HashMapImplementation<K extends Hashable, V> implements HashMap<K, V> {
7 7
8 // The [_keys] list contains the keys inserted in the map. 8 // The [_keys] list contains the keys inserted in the map.
9 // The [_keys] list must be a raw list because it 9 // The [_keys] list must be a raw list because it
10 // will contain both elements of type K, and the [_DELETED_KEY] of type 10 // will contain both elements of type K, and the [_DELETED_KEY] of type
(...skipping 19 matching lines...) Expand all
30 int _loadLimit; 30 int _loadLimit;
31 31
32 // The current number of entries in the map. Will never be greater 32 // The current number of entries in the map. Will never be greater
33 // than [_loadLimit]. 33 // than [_loadLimit].
34 int _numberOfEntries; 34 int _numberOfEntries;
35 35
36 // The current number of deleted entries in the map. 36 // The current number of deleted entries in the map.
37 int _numberOfDeleted; 37 int _numberOfDeleted;
38 38
39 // The sentinel when a key is deleted from the map. 39 // The sentinel when a key is deleted from the map.
40 static final _DeletedKeySentinel _DELETED_KEY = const _DeletedKeySentinel(); 40 static const _DeletedKeySentinel _DELETED_KEY = const _DeletedKeySentinel();
41 41
42 // The initial capacity of a hash map. 42 // The initial capacity of a hash map.
43 static final int _INITIAL_CAPACITY = 8; // must be power of 2 43 static const int _INITIAL_CAPACITY = 8; // must be power of 2
44 44
45 HashMapImplementation() { 45 HashMapImplementation() {
46 _numberOfEntries = 0; 46 _numberOfEntries = 0;
47 _numberOfDeleted = 0; 47 _numberOfDeleted = 0;
48 _loadLimit = _computeLoadLimit(_INITIAL_CAPACITY); 48 _loadLimit = _computeLoadLimit(_INITIAL_CAPACITY);
49 _keys = new List(_INITIAL_CAPACITY); 49 _keys = new List(_INITIAL_CAPACITY);
50 _values = new List<V>(_INITIAL_CAPACITY); 50 _values = new List<V>(_INITIAL_CAPACITY);
51 } 51 }
52 52
53 factory HashMapImplementation.from(Map<K, V> other) { 53 factory HashMapImplementation.from(Map<K, V> other) {
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 445
446 /** 446 /**
447 * A singleton sentinel used to represent when a key is deleted from the map. 447 * A singleton sentinel used to represent when a key is deleted from the map.
448 * We can't use [: const Object() :] as a sentinel because it would end up 448 * We can't use [: const Object() :] as a sentinel because it would end up
449 * canonicalized and then we cannot distinguish the deleted key from the 449 * canonicalized and then we cannot distinguish the deleted key from the
450 * canonicalized [: Object() :]. 450 * canonicalized [: Object() :].
451 */ 451 */
452 class _DeletedKeySentinel { 452 class _DeletedKeySentinel {
453 const _DeletedKeySentinel(); 453 const _DeletedKeySentinel();
454 } 454 }
OLDNEW
« no previous file with comments | « lib/coreimpl/dual_pivot_quicksort.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698