getOrCreateUser already checks for Hex64. No need to do it twice

This commit is contained in:
Vitor Pamplona
2025-10-06 15:44:13 -04:00
parent 456ef86c85
commit b546294078

View File

@@ -297,12 +297,7 @@ object LocalCache : ILocalCache {
observablesByKindAndAuthor[event.kind]?.get(event.pubKey)?.updateIfMatches(event)
}
fun checkGetOrCreateUser(key: String): User? {
if (isValidHex(key)) {
return getOrCreateUser(key)
}
return null
}
fun checkGetOrCreateUser(key: String): User? = getOrCreateUser(key)
fun getOrCreateUser(key: HexKey): User {
require(isValidHex(key = key)) { "$key is not a valid hex" }