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

Issue 26681002: Add EfficientLength marker interface to some iterabels. (Closed)

Created:
7 years, 2 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 2 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Add EfficientLength marker interface to some iterabels. Use that in List.from and other methods to be more efficient when possible. R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=28575

Patch Set 1 #

Total comments: 9

Patch Set 2 : Moved EfficientLength interface to _collection-dev. #

Patch Set 3 : Added argument tests for skip/take. Use specialized constructor directly in some cases. #

Patch Set 4 : Address comments: Document length is efficient for List, Set, Queue. #

Patch Set 5 : Also document Map.length is efficient, while we are at it. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+233 lines, -56 lines) Patch
M pkg/intl/lib/number_format.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/collection_patch.dart View 3 chunks +6 lines, -3 lines 0 comments Download
M runtime/lib/immutable_map.dart View 1 chunk +8 lines, -2 lines 0 comments Download
M sdk/lib/_collection_dev/iterable.dart View 1 2 13 chunks +131 lines, -15 lines 0 comments Download
M sdk/lib/_internal/lib/collection_patch.dart View 2 chunks +4 lines, -2 lines 0 comments Download
M sdk/lib/_internal/lib/constant_map.dart View 1 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/collection/iterable.dart View 1 2 chunks +2 lines, -0 lines 0 comments Download
M sdk/lib/collection/list.dart View 1 2 3 2 chunks +24 lines, -5 lines 0 comments Download
M sdk/lib/collection/queue.dart View 1 2 3 3 chunks +20 lines, -18 lines 0 comments Download
M sdk/lib/collection/splay_tree.dart View 2 chunks +4 lines, -2 lines 0 comments Download
M sdk/lib/core/iterable.dart View 2 chunks +4 lines, -3 lines 0 comments Download
M sdk/lib/core/list.dart View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M sdk/lib/core/map.dart View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download
M sdk/lib/core/set.dart View 1 2 3 2 chunks +9 lines, -1 line 0 comments Download
M sdk/lib/utf/utf.dart View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Lasse Reichstein Nielsen
What do you think?
7 years, 2 months ago (2013-10-09 10:24:50 UTC) #1
srdjan
DBC: I think this is a very bad design and misuse of subtyping. There must ...
7 years, 2 months ago (2013-10-09 16:13:52 UTC) #2
kevmoo-old
DBC (Since it's been a while since I've made a "well in .NET..." comment) Iterable: ...
7 years, 2 months ago (2013-10-09 17:05:06 UTC) #3
sra1
On 2013/10/09 16:13:52, srdjan wrote: > DBC: > > I think this is a very ...
7 years, 2 months ago (2013-10-09 21:01:19 UTC) #4
sra1
https://codereview.chromium.org/26681002/diff/1/sdk/lib/_collection_dev/iterable.dart File sdk/lib/_collection_dev/iterable.dart (right): https://codereview.chromium.org/26681002/diff/1/sdk/lib/_collection_dev/iterable.dart#newcode585 sdk/lib/_collection_dev/iterable.dart:585: if (_skipCount is! int || _skipCount < 0) { ...
7 years, 2 months ago (2013-10-09 21:16:52 UTC) #5
Lasse Reichstein Nielsen
On 2013/10/09 16:13:52, srdjan wrote: > DBC: > > I think this is a very ...
7 years, 2 months ago (2013-10-10 06:25:15 UTC) #6
floitsch
LGTM with comments. In particular I want the tagging-interface to be hidden and not public. ...
7 years, 2 months ago (2013-10-10 13:04:52 UTC) #7
floitsch
On 2013/10/10 13:04:52, floitsch wrote: > LGTM with comments. > In particular I want the ...
7 years, 2 months ago (2013-10-10 13:06:28 UTC) #8
sra1
https://codereview.chromium.org/26681002/diff/1/sdk/lib/collection/queue.dart File sdk/lib/collection/queue.dart (right): https://codereview.chromium.org/26681002/diff/1/sdk/lib/collection/queue.dart#newcode12 sdk/lib/collection/queue.dart:12: abstract class Queue<E> implements Iterable<E>, EfficientLength { On 2013/10/10 ...
7 years, 2 months ago (2013-10-10 17:02:41 UTC) #9
floitsch
https://codereview.chromium.org/26681002/diff/1/sdk/lib/collection/queue.dart File sdk/lib/collection/queue.dart (right): https://codereview.chromium.org/26681002/diff/1/sdk/lib/collection/queue.dart#newcode12 sdk/lib/collection/queue.dart:12: abstract class Queue<E> implements Iterable<E>, EfficientLength { On 2013/10/10 ...
7 years, 2 months ago (2013-10-10 17:12:05 UTC) #10
Lasse Reichstein Nielsen
I'm surprised that the Set interface doesn't require an efficient length either, and I would ...
7 years, 2 months ago (2013-10-11 05:44:32 UTC) #11
sra1
On 2013/10/11 05:44:32, Lasse Reichstein Nielsen wrote: > I'm surprised that the Set interface doesn't ...
7 years, 2 months ago (2013-10-11 07:20:11 UTC) #12
Lasse Reichstein Nielsen
On 2013/10/11 07:20:11, sra1 wrote: > On 2013/10/11 05:44:32, Lasse Reichstein Nielsen wrote: > > ...
7 years, 2 months ago (2013-10-11 09:01:16 UTC) #13
Lasse Reichstein Nielsen
7 years, 2 months ago (2013-10-14 10:40:17 UTC) #14
Message was sent while issue was closed.
Committed patchset #5 manually as r28575 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698