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

Issue 11664006: Make Map.keys/values Iterables. (Closed)

Created:
8 years ago by floitsch
Modified:
7 years, 11 months ago
CC:
reviews_dartlang.org, Anders Johnsen
Visibility:
Public.

Description

Make Map.keys/values Iterables. Committed: https://code.google.com/p/dart/source/detail?r=16600

Patch Set 1 #

Patch Set 2 : Added tests and fixes. #

Patch Set 3 : Fix type. #

Total comments: 4

Patch Set 4 : Add TODO that map.keys should return a Set. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+435 lines, -167 lines) Patch
M editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/testsource/CoreRuntimeTypesTest.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M pkg/args/lib/args.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/intl/lib/date_format.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/serialization/lib/src/serialization_helpers.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M pkg/serialization/lib/src/serialization_rule.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M pkg/serialization/test/serialization_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/immutable_map.dart View 1 2 chunks +65 lines, -14 lines 0 comments Download
M runtime/tests/vm/dart/isolate_mirror_local_test.dart View 4 chunks +6 lines, -6 lines 0 comments Download
M samples/swarm/Views.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/closure.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/constant_map.dart View 1 2 chunks +12 lines, -5 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/library_loader.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/native_handler.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/resolution/scope.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/dartdoc/lib/src/dartdoc/utils.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/dartdoc/lib/src/markdown/html_renderer.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/core/map.dart View 1 2 3 4 chunks +82 lines, -51 lines 0 comments Download
M sdk/lib/html/src/Serialization.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/resolver_test.dart View 4 chunks +5 lines, -5 lines 0 comments Download
M tests/compiler/dart2js_extra/type_argument_factory_crash_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js_extra/type_argument_factory_nocrash_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/corelib/core_runtime_types_test.dart View 1 chunk +4 lines, -4 lines 0 comments Download
M tests/corelib/corelib.status View 1 1 chunk +8 lines, -2 lines 0 comments Download
A tests/corelib/map_keys2_test.dart View 1 1 chunk +32 lines, -0 lines 0 comments Download
A tests/corelib/map_keys_test.dart View 1 1 chunk +45 lines, -0 lines 0 comments Download
M tests/corelib/map_test.dart View 3 chunks +3 lines, -3 lines 0 comments Download
A tests/corelib/map_values2_test.dart View 1 1 chunk +51 lines, -0 lines 0 comments Download
A tests/corelib/map_values_test.dart View 1 1 chunk +45 lines, -0 lines 0 comments Download
M tests/html/localstorage_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/compile_time_constant_a_test.dart View 4 chunks +8 lines, -8 lines 0 comments Download
M tests/language/compile_time_constant_b_test.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M tests/language/map_test.dart View 3 chunks +4 lines, -4 lines 0 comments Download
M tests/language/ordered_maps_test.dart View 2 chunks +10 lines, -10 lines 0 comments Download
M tests/standalone/io/url_encoding_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/apidoc/mdn/prettyPrint.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/archive/options.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/pub/pubspec.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/pub/version_solver.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M utils/pub/yaml/model.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M utils/pub/yaml/yaml_map.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M utils/template/parser.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/tests/pub/test_pub.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/tests/pub/version_solver_test.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
floitsch
8 years ago (2012-12-21 15:23:37 UTC) #1
floitsch
8 years ago (2012-12-21 17:52:24 UTC) #2
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/11664006/diff/5001/sdk/lib/core/map.dart File sdk/lib/core/map.dart (right): https://codereview.chromium.org/11664006/diff/5001/sdk/lib/core/map.dart#newcode74 sdk/lib/core/map.dart:74: Iterable<K> get keys; You can make it (unmodifiable) ...
8 years ago (2012-12-22 22:09:24 UTC) #3
floitsch
7 years, 11 months ago (2013-01-03 13:35:41 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/11664006/diff/5001/sdk/lib/core/map.dart
File sdk/lib/core/map.dart (right):

https://codereview.chromium.org/11664006/diff/5001/sdk/lib/core/map.dart#newc...
sdk/lib/core/map.dart:74: Iterable<K> get keys;
On 2012/12/22 22:09:24, Lasse Reichstein Nielsen wrote:
> You can make it (unmodifiable) Set<K>, and it would make sense. The only extra
> feature on top of Iterable is contains, and we have containsKey in Map to
> implement it by.

contains is actually in Iterable, so apparently a Set does not add any method
(yet).

I agree that 'keys' should become a Set, but I will do this in a separate CL.
Added a TODO.

https://codereview.chromium.org/11664006/diff/5001/sdk/lib/core/map.dart#newc...
sdk/lib/core/map.dart:375: class _HashMapImplKeyIterable<E> extends Iterable<E>
{
On 2012/12/22 22:09:24, Lasse Reichstein Nielsen wrote:
> Extend _UnmodifiableSet (which we should have at some point, if we don't
> already), and implement contains through _map.containsKeu.

In a future CL. but I agree.

Powered by Google App Engine
This is Rietveld 408576698