Skip to content

Commit 2b3b91c

Browse files
committed
rename function and use
The function in this class was not used but we can rename it and use it as it uses the removeAt function which we need due to the collision with the stdlib.
1 parent 2d04724 commit 2b3b91c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/com/duckduckgo/app/global/view/ViewChildrenSequences.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private class ViewChildrenRecursiveSequence(private val view: View) : Sequence<V
6767

6868
private class RecursiveViewIterator(view: View) : Iterator<View> {
6969
private val sequences = arrayListOf(view.childrenSequence())
70-
private var current = sequences.removeLast().iterator()
70+
private var current = sequences.removeLastElement().iterator()
7171

7272
override fun next(): View {
7373
if (!hasNext()) throw NoSuchElementException()
@@ -80,13 +80,13 @@ private class ViewChildrenRecursiveSequence(private val view: View) : Sequence<V
8080

8181
override fun hasNext(): Boolean {
8282
if (!current.hasNext() && sequences.isNotEmpty()) {
83-
current = sequences.removeLast().iterator()
83+
current = sequences.removeLastElement().iterator()
8484
}
8585
return current.hasNext()
8686
}
8787

8888
@Suppress("NOTHING_TO_INLINE")
89-
private inline fun <T : Any> MutableList<T>.removeLast(): T {
89+
private inline fun <T : Any> MutableList<T>.removeLastElement(): T {
9090
if (isEmpty()) throw NoSuchElementException()
9191
return removeAt(size - 1)
9292
}

0 commit comments

Comments
 (0)