Chromium Code Reviews
Help | Chromium Project | Sign in
(1)

Issue 11896013: Add List.reversed to give a reverse fixed-length view of a list. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 2 months ago by Lasse Reichstein Nielsen
Modified:
1 year, 2 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add List.reversed to give a reverse fixed-length view of a list.

Committed: https://code.google.com/p/dart/source/detail?r=17402

Patch Set 1 #

Total comments: 8

Patch Set 2 : Made reversed list work when list length changes. #

Patch Set 3 : Address comments, cleanup. #

Total comments: 16

Patch Set 4 : Moved some functionality to separate CL. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+391 lines, -53 lines) Lint Patch
M pkg/serialization/lib/src/serialization_rule.dart View 1 chunk +1 line, -0 lines 0 comments ? errors Download
M runtime/lib/array.dart View 1 2 chunks +4 lines, -0 lines 0 comments ? errors Download
M runtime/lib/growable_array.dart View 1 1 chunk +2 lines, -0 lines 0 comments ? errors Download
M samples/swarm/swarm_ui_lib/observable/observable.dart View 1 1 chunk +2 lines, -0 lines 0 comments ? errors Download
M sdk/lib/_internal/compiler/implementation/lib/js_array.dart View 1 1 chunk +2 lines, -0 lines 0 comments ? errors Download
M sdk/lib/collection_dev/list.dart View 1 2 3 6 chunks +299 lines, -39 lines 0 comments ? errors Download
M sdk/lib/core/errors.dart View 1 2 2 chunks +27 lines, -0 lines 0 comments ? errors Download
M sdk/lib/core/list.dart View 1 2 1 chunk +9 lines, -0 lines 0 comments ? errors Download
M sdk/lib/html/html_common/filtered_element_list.dart View 1 1 chunk +2 lines, -0 lines 0 comments ? errors Download
M tests/corelib/list_iterators_test.dart View 1 2 3 2 chunks +3 lines, -14 lines 0 comments ? errors Download
A tests/corelib/list_reversed_test.dart View 1 2 3 1 chunk +40 lines, -0 lines 0 comments ? errors Download
Trybot results:
Commit:

Messages

Total messages: 7
Lasse Reichstein Nielsen
1 year, 2 months ago #1
floitsch
Skipped the actual ReversedList code, until it doesn't throw for length changes. Please add tests. ...
1 year, 2 months ago #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/11896013/diff/1/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/11896013/diff/1/sdk/lib/core/list.dart#newcode574 sdk/lib/core/list.dart:574: * list changes its length below the slice used ...
1 year, 2 months ago #3
floitsch
On 2013/01/21 14:43:40, Lasse Reichstein Nielsen wrote: > https://codereview.chromium.org/11896013/diff/1/sdk/lib/core/list.dart > File sdk/lib/core/list.dart (right): > > ...
1 year, 2 months ago #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/11896013/diff/1/sdk/lib/core/list.dart File sdk/lib/core/list.dart (right): https://codereview.chromium.org/11896013/diff/1/sdk/lib/core/list.dart#newcode209 sdk/lib/core/list.dart:209: abstract class BaseListMixin<E> extends Iterable<E> implements List<E> { Moved ...
1 year, 2 months ago #5
floitsch
LGTM. make sure you don't break co19 tests that rely on concurrent modifications. https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/list.dart File ...
1 year, 2 months ago #6
Lasse Reichstein Nielsen
1 year, 2 months ago #7
co19 didn't need changes at all. It's unspecified behavior in any case.

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
File sdk/lib/collection_dev/list.dart (right):

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
sdk/lib/collection_dev/list.dart:272: * Iterates over a [Sequence] in growing
index order.
Fixed.

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
sdk/lib/collection_dev/list.dart:276: final int _initialLength;
Done.

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
sdk/lib/collection_dev/list.dart:410: void operator []=(int index, E value) {
Moved to separate CL.

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
sdk/lib/collection_dev/list.dart:425: return new EmptyList<E>();
I dare not assume it can't happen. Call it safety in depth.

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
sdk/lib/collection_dev/list.dart:439: return new EmptyList<E>();
Same.

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
sdk/lib/collection_dev/list.dart:450: void sort([int compare(E first, E
second)]) {
On 2013/01/22 14:24:57, floitsch wrote:
> Different CL together with []=.

Done.

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
sdk/lib/collection_dev/list.dart:487: void operator []=(int index, E value) {
On 2013/01/22 14:24:57, floitsch wrote:
> Different CL.

Done.

https://codereview.chromium.org/11896013/diff/7001/sdk/lib/collection_dev/lis...
sdk/lib/collection_dev/list.dart:534: void sort([int compare(E first, E
second)]) {
On 2013/01/22 14:24:57, floitsch wrote:
> different CL.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1280:2d3e6564b7b6