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

Unified Diff: pkg/analyzer/lib/src/generated/utilities_collection.dart

Issue 1151723002: Don't get value in SingleMapIterator until it is requested. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/utilities_collection.dart
diff --git a/pkg/analyzer/lib/src/generated/utilities_collection.dart b/pkg/analyzer/lib/src/generated/utilities_collection.dart
index 47dd4f61d46e47033baa2fed7cefb8604f64fa94..bd03a10797372edce52f976e0b3cba565d995d76 100644
--- a/pkg/analyzer/lib/src/generated/utilities_collection.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_collection.dart
@@ -681,6 +681,9 @@ class SingleMapIterator<K, V> implements MapIterator<K, V> {
if (_currentKey == null) {
throw new NoSuchElementException();
}
+ if (_currentValue == null) {
+ _currentValue = _map[_currentKey];
+ }
return _currentValue;
}
@@ -697,7 +700,7 @@ class SingleMapIterator<K, V> implements MapIterator<K, V> {
bool moveNext() {
if (_keyIterator.moveNext()) {
_currentKey = _keyIterator.current;
- _currentValue = _map[_currentKey];
+ _currentValue = null;
return true;
} else {
_currentKey = null;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698