mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:20:36 +00:00
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:
parent
d54fb071a9
commit
1a3853b128
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue