Skip to content

Commit 046ea73

Browse files
committed
Apply Kotlin suggestion by @Isira-Seneviratne
1 parent 3998982 commit 046ea73

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,12 +1931,8 @@ class VideoDetailFragment :
19311931
}
19321932

19331933
private fun findQueueInStack(queue: PlayQueue): StackItem? {
1934-
stack.descendingIterator().forEach { item ->
1935-
if (item?.playQueue == queue) {
1936-
return@findQueueInStack item
1937-
}
1938-
}
1939-
return null
1934+
return stack.descendingIterator().asSequence()
1935+
.firstOrNull { it?.playQueue?.equals(queue) == true }
19401936
}
19411937

19421938
private fun replaceQueueIfUserConfirms(onAllow: Runnable) {

0 commit comments

Comments
 (0)