Limit visibility of sublists, make them implement RandomAccess

This commit is contained in:
Ilya Gorbunov
2017-05-06 06:10:10 +03:00
parent d7ad1f3950
commit 4798c029de
2 changed files with 4 additions and 4 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ public abstract class AbstractList<out E> protected constructor() : AbstractColl
override fun subList(fromIndex: Int, toIndex: Int): List<E> = SubList(this, fromIndex, toIndex)
internal open class SubList<out E>(private val list: AbstractList<E>, private val fromIndex: Int, toIndex: Int) : AbstractList<E>() {
private class SubList<out E>(private val list: AbstractList<E>, private val fromIndex: Int, toIndex: Int) : AbstractList<E>(), RandomAccess {
private var _size: Int = 0
init {