Use weak caches for custom textures

This commit is contained in:
Linnea Gräf
2024-09-24 11:40:15 +02:00
parent 64099bd262
commit 420f2a61e1
18 changed files with 308 additions and 78 deletions

View File

@@ -0,0 +1,9 @@
package moe.nea.firmament.util.collections
fun <T, R> List<T>.lastNotNullOfOrNull(func: (T) -> R?): R? {
for (i in indices.reversed()) {
return func(this[i]) ?: continue
}
return null
}