mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-21 23:15:23 +00:00
Fix Snode Version CACHE usage
This commit is contained in:
parent
61cb602e63
commit
fa0abef243
@ -42,10 +42,7 @@ class Snode(val address: String, val port: Int, val publicKeySet: KeySet?, val v
|
||||
private val CACHE = mutableMapOf<String, Version>()
|
||||
|
||||
@SuppressLint("NotConstructor")
|
||||
fun Version(value: String) = CACHE.getOrElse(value) {
|
||||
// internal constructor takes precedence
|
||||
Snode.Version(value)
|
||||
}
|
||||
fun Version(value: String) = CACHE[value] ?: Snode.Version(value).also { CACHE[value] = it }
|
||||
|
||||
fun Version(parts: List<Int>) = Version(parts.joinToString("."))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user