diff --git a/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/NodeManagerImpl.kt b/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/NodeManagerImpl.kt index f5111bdb2..0b24b3004 100644 --- a/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/NodeManagerImpl.kt +++ b/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/NodeManagerImpl.kt @@ -71,19 +71,19 @@ class NodeManagerImpl( var nextById = byId // If the user.id changed (e.g. firmware reassigned the hex id) drop the stale id entry. if (previous != null && previous.user.id.isNotEmpty() && previous.user.id != node.user.id) { - nextById = nextById.remove(previous.user.id) + nextById = nextById.removing(previous.user.id) } if (node.user.id.isNotEmpty()) { - nextById = nextById.put(node.user.id, node) + nextById = nextById.putting(node.user.id, node) } - return NodeIndex(byNum = byNum.put(num, node), byId = nextById) + return NodeIndex(byNum = byNum.putting(num, node), byId = nextById) } fun remove(num: Int): NodeIndex { val previous = byNum[num] ?: return this return NodeIndex( - byNum = byNum.remove(num), - byId = if (previous.user.id.isNotEmpty()) byId.remove(previous.user.id) else byId, + byNum = byNum.removing(num), + byId = if (previous.user.id.isNotEmpty()) byId.removing(previous.user.id) else byId, ) } @@ -92,8 +92,8 @@ class NodeManagerImpl( var byNum = persistentMapOf() var byId = persistentMapOf() for ((num, node) in nodes) { - byNum = byNum.put(num, node) - if (node.user.id.isNotEmpty()) byId = byId.put(node.user.id, node) + byNum = byNum.putting(num, node) + if (node.user.id.isNotEmpty()) byId = byId.putting(node.user.id, node) } return NodeIndex(byNum, byId) } diff --git a/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/RequestTimer.kt b/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/RequestTimer.kt index 1dde1d6a8..42a2c3414 100644 --- a/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/RequestTimer.kt +++ b/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/RequestTimer.kt @@ -37,7 +37,7 @@ internal class RequestTimer { /** Records the start time for [requestId]. */ fun start(requestId: Int) { - startTimes.update { it.put(requestId, nowMillis) } + startTimes.update { it.putting(requestId, nowMillis) } } /** @@ -46,7 +46,7 @@ internal class RequestTimer { */ fun appendDuration(requestId: Int, text: String, logLabel: String): String { val start = startTimes.value[requestId] - startTimes.update { it.remove(requestId) } + startTimes.update { it.removing(requestId) } if (start == null) return text val seconds = (nowMillis - start) / MILLIS_PER_SECOND Logger.i { "$logLabel $requestId complete in $seconds s" } diff --git a/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/SessionManagerImpl.kt b/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/SessionManagerImpl.kt index 9a9c290f5..54ee69120 100644 --- a/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/SessionManagerImpl.kt +++ b/core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/SessionManagerImpl.kt @@ -63,7 +63,7 @@ class SessionManagerImpl(private val clock: Clock) : SessionManager { override fun recordSession(srcNodeNum: Int, passkey: ByteString) { if (passkey.size == 0) return val now = clock.now() - entries.update { it.put(srcNodeNum, SessionEntry(passkey, now)) } + entries.update { it.putting(srcNodeNum, SessionEntry(passkey, now)) } Logger.d { "Recorded session refresh from $srcNodeNum (${passkey.size} bytes)" } refreshFlow.tryEmit(srcNodeNum) } diff --git a/core/prefs/src/commonMain/kotlin/org/meshtastic/core/prefs/FlowCache.kt b/core/prefs/src/commonMain/kotlin/org/meshtastic/core/prefs/FlowCache.kt index 2d8602c8b..ae9e18fdd 100644 --- a/core/prefs/src/commonMain/kotlin/org/meshtastic/core/prefs/FlowCache.kt +++ b/core/prefs/src/commonMain/kotlin/org/meshtastic/core/prefs/FlowCache.kt @@ -42,7 +42,7 @@ internal inline fun cachedFlow( current[key]?.let { return it.value } - if (cache.compareAndSet(current, current.put(key, newLazy))) { + if (cache.compareAndSet(current, current.putting(key, newLazy))) { return newLazy.value } }