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

Issue 12041045: List.mappedBy/skip/take returns a List. (Closed)

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

Description

Patch Set 1 #

Total comments: 16

Patch Set 2 : Address comments #

Patch Set 3 : Fix typo and revert bad change. #

Patch Set 4 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -1 line) Patch
M sdk/lib/collection_dev/list.dart View 1 2 3 2 chunks +13 lines, -1 line 0 comments Download
M sdk/lib/core/list.dart View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
A tests/corelib/iterable_mapping_test.dart View 1 2 1 chunk +55 lines, -0 lines 0 comments Download
M tests/corelib/iterable_skip_test.dart View 7 chunks +21 lines, -0 lines 0 comments Download
M tests/corelib/iterable_take_test.dart View 8 chunks +22 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
floitsch
7 years, 11 months ago (2013-01-23 16:10:13 UTC) #1
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/12041045/diff/1/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/12041045/diff/1/sdk/lib/core/list.dart#newcode204 sdk/lib/core/list.dart:204: * by the result of [:f(e):]. Mention "unmodifiable" ...
7 years, 11 months ago (2013-01-24 06:49:32 UTC) #2
floitsch
https://codereview.chromium.org/12041045/diff/1/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/12041045/diff/1/sdk/lib/core/list.dart#newcode204 sdk/lib/core/list.dart:204: * by the result of [:f(e):]. On 2013/01/24 06:49:32, ...
7 years, 11 months ago (2013-01-24 13:48:34 UTC) #3
Sean Eagan
On 2013/01/23 16:10:13, floitsch wrote: You probably already thought of this, but: * same for ...
7 years, 11 months ago (2013-01-24 17:36:23 UTC) #4
floitsch
7 years, 10 months ago (2013-01-28 16:32:55 UTC) #5
Message was sent while issue was closed.
On 2013/01/24 17:36:23, seaneagan1 wrote:
> On 2013/01/23 16:10:13, floitsch wrote:
> 
> You probably already thought of this, but:
> 
> * same for where, takeWhile, and skipWhile?
> * should corresponding methods on Sets return Sets (other than mappedBy)?
> 
> Thanks!

where, takeWhile and skipWhile are not lists, since there is no immediate
mapping of indices.
Sets are more difficult. For 'where', the contains-method can (and should) be
made more efficient, but since the length is not O(1) I wouldn't call it a Set.
For 'mappedBy' the length stays the same, but the contains becomes O(n). So
definitely not a Set.
In general Sets are not as clear-cut as Lists, where mappedBy, skip and take
really just wrap the original list and provide efficient List interfaces.

Powered by Google App Engine
This is Rietveld 408576698