Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
306 B
14 lines
306 B
4 years ago
|
package dev.openrs2.common.collect
|
||
|
|
||
|
inline fun <T> MutableIterable<T>.removeFirst(predicate: (T) -> Boolean): Boolean {
|
||
|
val iterator = iterator()
|
||
|
for (element in iterator) {
|
||
|
if (predicate(element)) {
|
||
|
iterator.remove()
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return false
|
||
|
}
|