mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
caching for non-ram music
This commit is contained in:
@@ -8,9 +8,7 @@ class MusicCache(val trackName: String) : Disposable {
|
||||
private val cache = HashMap<String, MusicContainer>()
|
||||
|
||||
fun getOrPut(music: MusicContainer?): MusicContainer? {
|
||||
if (music != null && !music.toRAM)
|
||||
return music
|
||||
if (music != null && music.toRAM) // for now only the on-the-RAM tracks are getting cached
|
||||
if (music != null)
|
||||
return cache.getOrPut(music.name) { music.makeCopy() }
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user