Improve comment in UnmodifiableListView.

The class already states that the source must have efficient-length, but
the constructor didn't reiterate this requirement.

R=lrn@google.com

Review URL: https://codereview.chromium.org/1510043002 .
This commit is contained in:
Florian Loitsch 2015-12-09 21:25:55 +01:00
parent d54fb071a9
commit 1a3853b128

View file

@ -12,7 +12,13 @@ part of dart.collection;
*/
class UnmodifiableListView<E> extends UnmodifiableListBase<E> {
final Iterable<E> _source;
/** Create an unmodifiable list backed by [source]. */
/**
* Creates an unmodifiable list backed by [source].
*
* The [source] of the elements may be a [List] or any [Iterable] with
* efficient [Iterable.length] and [Iterable.elementAt].
*/
UnmodifiableListView(Iterable<E> source) : _source = source;
int get length => _source.length;
E operator[](int index) => _source.elementAt(index);