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

Unified Diff: corelib/src/implementation/hash_map_set.dart

Issue 9250005: Fix dartc in optimized mode (broken in r3358). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 11 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
Index: corelib/src/implementation/hash_map_set.dart
diff --git a/corelib/src/implementation/hash_map_set.dart b/corelib/src/implementation/hash_map_set.dart
index caea8659e6c5e07736efddd622fcad19394e6b01..a05f9f5a4a6374b73189b5411dbef045f7f8e3a1 100644
--- a/corelib/src/implementation/hash_map_set.dart
+++ b/corelib/src/implementation/hash_map_set.dart
@@ -228,8 +228,9 @@ class HashMapImplementation<K extends Hashable, V> implements HashMap<K, V> {
void forEach(void f(K key, V value)) {
int length = _keys.length;
for (int i = 0; i < length; i++) {
- if ((_keys[i] !== null) && (_keys[i] !== _DELETED_KEY)) {
- f(_keys[i], _values[i]);
+ K key = _keys[i];
+ if ((key !== null) && (key !== _DELETED_KEY)) {
+ f(key, _values[i]);
}
}
}
@@ -260,7 +261,8 @@ class HashMapImplementation<K extends Hashable, V> implements HashMap<K, V> {
bool containsValue(V value) {
int length = _values.length;
for (int i = 0; i < length; i++) {
- if ((_keys[i] !== null) && (_keys[i] !== _DELETED_KEY)) {
+ K key = _keys[i];
+ if ((key !== null) && (key !== _DELETED_KEY)) {
if (_values[i] == value) return true;
}
}

Powered by Google App Engine
This is Rietveld 408576698