commonMain.it.unibo.tuprolog.solve.channel.impl.ChannelStoreUtils.kt Maven / Gradle / Ivy
package it.unibo.tuprolog.solve.channel.impl
import it.unibo.tuprolog.solve.channel.Channel
import it.unibo.tuprolog.solve.channel.ChannelStore
internal object ChannelStoreUtils {
fun > MutableMap.ensureAliasRefersToChannel(
key: String,
channel: C,
): MutableMap {
this[key] = channel
return this
}
fun > MutableMap.setCurrent(
key: String,
defaultChannel: C,
): MutableMap {
if (ChannelStore.CURRENT !in this) {
this[ChannelStore.CURRENT] = this[key] ?: defaultChannel
}
return this
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy