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

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

Created:
7 years, 11 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 11 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) Patch
M pkg/serialization/lib/src/serialization_rule.dart View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/lib/array.dart View 1 2 chunks +4 lines, -0 lines 0 comments Download
M runtime/lib/growable_array.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M samples/swarm/swarm_ui_lib/observable/observable.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_array.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M sdk/lib/collection_dev/list.dart View 1 2 3 6 chunks +299 lines, -39 lines 0 comments Download
M sdk/lib/core/errors.dart View 1 2 2 chunks +27 lines, -0 lines 0 comments Download
M sdk/lib/core/list.dart View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M sdk/lib/html/html_common/filtered_element_list.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M tests/corelib/list_iterators_test.dart View 1 2 3 2 chunks +3 lines, -14 lines 0 comments Download
A tests/corelib/list_reversed_test.dart View 1 2 3 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Lasse Reichstein Nielsen
7 years, 11 months ago (2013-01-21 14:05:11 UTC) #1
floitsch
Skipped the actual ReversedList code, until it doesn't throw for length changes. Please add tests. ...
7 years, 11 months ago (2013-01-21 14:38:06 UTC) #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 ...
7 years, 11 months ago (2013-01-21 14:43:40 UTC) #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): > > ...
7 years, 11 months ago (2013-01-21 15:05:55 UTC) #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 ...
7 years, 11 months ago (2013-01-22 10:18:52 UTC) #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 ...
7 years, 11 months ago (2013-01-22 14:24:57 UTC) #6
Lasse Reichstein Nielsen
7 years, 11 months ago (2013-01-22 14:55:12 UTC) #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.

Powered by Google App Engine
This is Rietveld 408576698