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

Unified Diff: runtime/lib/immutable_map.dart

Issue 1620923002: Remove stale comment in ImmutableList implementation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« 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: runtime/lib/immutable_map.dart
diff --git a/runtime/lib/immutable_map.dart b/runtime/lib/immutable_map.dart
index 2377c8c3d0909c964b6828498209839abc9f91b6..b8d0d3c62d7b9cb8ed74402db42413aba5f6c39e 100644
--- a/runtime/lib/immutable_map.dart
+++ b/runtime/lib/immutable_map.dart
@@ -11,8 +11,9 @@ class ImmutableMap<K, V> implements Map<K, V> {
V operator [](Object key) {
- // TODO(hausner): Since the keys are sorted, we could do a binary
- // search. But is it worth it?
+ // To preserve the key-value order of the map literal, the keys are
+ // not sorted. Need to do linear search or implement an additional
+ // lookup table.
for (int i = 0; i < _kvPairs.length - 1; i += 2) {
if (key == _kvPairs[i]) {
return _kvPairs[i+1];
« 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