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

Unified Diff: runtime/lib/immutable_map.dart

Issue 23619086: Adapt private variables with trailing underscores. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_collection_dev/sort.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/immutable_map.dart
diff --git a/runtime/lib/immutable_map.dart b/runtime/lib/immutable_map.dart
index 77127e5ca8e608895de4d71b91a9bd2b3f76ae2c..65db0c9efeffa4572ba6dd3584adf788f161674f 100644
--- a/runtime/lib/immutable_map.dart
+++ b/runtime/lib/immutable_map.dart
@@ -4,36 +4,36 @@
// Immutable map class for compiler generated map literals.
class ImmutableMap<K, V> implements Map<K, V> {
- final _ImmutableArray kvPairs_;
+ final _ImmutableArray _kvPairs;
const ImmutableMap._create(_ImmutableArray keyValuePairs)
- : kvPairs_ = keyValuePairs;
+ : _kvPairs = keyValuePairs;
V operator [](Object key) {
// TODO(hausner): Since the keys are sorted, we could do a binary
// search. But is it worth it?
Lasse Reichstein Nielsen 2013/09/24 07:43:21 Add a comment here: Yes, it may be worth it if map
floitsch 2013/09/24 11:19:13 There is already a TODO. No need to add our expect
- for (int i = 0; i < kvPairs_.length - 1; i += 2) {
- if (key == kvPairs_[i]) {
- return kvPairs_[i+1];
+ for (int i = 0; i < _kvPairs.length - 1; i += 2) {
+ if (key == _kvPairs[i]) {
+ return _kvPairs[i+1];
}
}
return null;
}
bool get isEmpty {
- return kvPairs_.length == 0;
+ return _kvPairs.length == 0;
}
bool get isNotEmpty => !isEmpty;
int get length {
- return kvPairs_.length ~/ 2;
+ return _kvPairs.length ~/ 2;
}
void forEach(void f(K key, V value)) {
- for (int i = 0; i < kvPairs_.length; i += 2) {
- f(kvPairs_[i], kvPairs_[i+1]);
+ for (int i = 0; i < _kvPairs.length; i += 2) {
+ f(_kvPairs[i], _kvPairs[i+1]);
}
}
@@ -46,8 +46,8 @@ class ImmutableMap<K, V> implements Map<K, V> {
}
bool containsKey(Object key) {
- for (int i = 0; i < kvPairs_.length; i += 2) {
- if (key == kvPairs_[i]) {
+ for (int i = 0; i < _kvPairs.length; i += 2) {
+ if (key == _kvPairs[i]) {
return true;
}
}
@@ -55,8 +55,8 @@ class ImmutableMap<K, V> implements Map<K, V> {
}
bool containsValue(Object value) {
- for (int i = 1; i < kvPairs_.length; i += 2) {
- if (value == kvPairs_[i]) {
+ for (int i = 1; i < _kvPairs.length; i += 2) {
+ if (value == _kvPairs[i]) {
return true;
}
}
@@ -113,7 +113,7 @@ class _ImmutableMapKeyIterator<E> implements Iterator<E> {
int newIndex = _index + 1;
if (newIndex < _map.length) {
_index = newIndex;
- _current = _map.kvPairs_[newIndex * 2];
+ _current = _map._kvPairs[newIndex * 2];
return true;
}
_current = null;
@@ -135,7 +135,7 @@ class _ImmutableMapValueIterator<E> implements Iterator<E> {
int newIndex = _index + 1;
if (newIndex < _map.length) {
_index = newIndex;
- _current = _map.kvPairs_[newIndex * 2 + 1];
+ _current = _map._kvPairs[newIndex * 2 + 1];
return true;
}
_current = null;
« no previous file with comments | « no previous file | sdk/lib/_collection_dev/sort.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698