Minor: more cleanups

This commit is contained in:
Mike Hearn
2017-04-12 12:00:03 +02:00
parent bea799c60d
commit ac337240a6
6 changed files with 7 additions and 9 deletions

View File

@ -44,7 +44,7 @@ class DBTransactionMappingStorage : StateMachineRecordedTransactionMappingStorag
private class InnerState {
val stateMachineTransactionMap = TransactionMappingsMap()
val updates = PublishSubject.create<StateMachineTransactionMapping>()!!
val updates: PublishSubject<StateMachineTransactionMapping> = PublishSubject.create()
}
private val mutex = ThreadBox(InnerState())

View File

@ -44,7 +44,7 @@ class DistributedImmutableMap<K : Any, V : Any>(val db: Database, tableName: Str
/** Gets a value for the given [Commands.Get.key] */
fun get(commit: Commit<Commands.Get<K, V>>): V? {
commit.use {
val key = commit.operation().key
val key = it.operation().key
return databaseTransaction(db) { map[key] }
}
}

View File

@ -20,7 +20,7 @@ class VaultSoftLockManager(val vault: VaultService, smm: StateMachineManager) {
init {
smm.changes.subscribe { (logic, addOrRemove, id) ->
if (addOrRemove == AddOrRemove.REMOVE && trackingFlowIds.contains(id.uuid)) {
if (addOrRemove == AddOrRemove.REMOVE && id.uuid in trackingFlowIds) {
log.trace { "$addOrRemove Flow name ${logic.javaClass} with id $id" }
unregisterSoftLocks(id, logic)
}