OLD | NEW |
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 patch class Expando<T> { | 5 patch class Expando<T> { |
6 /* patch */ Expando([this.name]) | 6 /* patch */ Expando([String this.name]) |
7 : _data = new List(_minSize), | 7 : _data = new List(_minSize), |
8 _used = 0; | 8 _used = 0; |
9 | 9 |
10 static const _minSize = 8; | 10 static const _minSize = 8; |
11 static final _deletedEntry = new _WeakProperty(null, null); | 11 static final _deletedEntry = new _WeakProperty(null, null); |
12 | 12 |
13 /* patch */ T operator[](Object object) { | 13 /* patch */ T operator[](Object object) { |
14 _checkType(object); | 14 _checkType(object); |
15 | 15 |
16 var mask = _size - 1; | 16 var mask = _size - 1; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 throw new ArgumentError(object); | 134 throw new ArgumentError(object); |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 get _size => _data.length; | 138 get _size => _data.length; |
139 get _limit => (3 * (_size ~/ 4)); | 139 get _limit => (3 * (_size ~/ 4)); |
140 | 140 |
141 List _data; | 141 List _data; |
142 int _used; // Number of used (active and deleted) slots. | 142 int _used; // Number of used (active and deleted) slots. |
143 } | 143 } |
OLD | NEW |