Allow to construct lazy array on the fly
This commit is contained in:
parent
058fe57a61
commit
a538357573
@ -16,6 +16,10 @@ class LazyList<T> : AbstractList<T> {
|
||||
this.getters = Array(getters.size) { getters[it] }
|
||||
}
|
||||
|
||||
constructor(size: Int, provider: (Int) -> () -> T) {
|
||||
this.getters = Array(size, provider)
|
||||
}
|
||||
|
||||
override val size: Int
|
||||
get() = getters.size
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user