Skip to content

Commit 0d893f0

Browse files
committed
Reformat
1 parent 74585c0 commit 0d893f0

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

core/src/commonMain/kotlin/com/powersync/db/ActiveInstanceStore.kt

+16-15
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,31 @@ internal class ActiveDatabaseGroup(
3535
}
3636
}
3737

38-
internal open class GroupsCollection: Synchronizable() {
38+
internal open class GroupsCollection : Synchronizable() {
3939
internal val allGroups = mutableListOf<ActiveDatabaseGroup>()
4040

4141
private fun findGroup(
4242
warnOnDuplicate: Logger,
4343
identifier: String,
44-
): ActiveDatabaseGroup = synchronize {
45-
val existing = allGroups.asSequence().firstOrNull { it.identifier == identifier }
46-
val resolvedGroup =
47-
if (existing == null) {
48-
val added = ActiveDatabaseGroup(identifier, this)
49-
allGroups.add(added)
50-
added
51-
} else {
52-
existing
44+
): ActiveDatabaseGroup =
45+
synchronize {
46+
val existing = allGroups.asSequence().firstOrNull { it.identifier == identifier }
47+
val resolvedGroup =
48+
if (existing == null) {
49+
val added = ActiveDatabaseGroup(identifier, this)
50+
allGroups.add(added)
51+
added
52+
} else {
53+
existing
54+
}
55+
56+
if (resolvedGroup.refCount++ != 0) {
57+
warnOnDuplicate.w { multipleInstancesMessage }
5358
}
5459

55-
if (resolvedGroup.refCount++ != 0) {
56-
warnOnDuplicate.w { multipleInstancesMessage }
60+
resolvedGroup
5761
}
5862

59-
resolvedGroup
60-
}
61-
6263
internal fun referenceDatabase(
6364
warnOnDuplicate: Logger,
6465
identifier: String,

core/src/commonTest/kotlin/com/powersync/db/ActiveDatabaseGroupTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import kotlin.test.assertNotNull
1212

1313
@OptIn(ExperimentalKermitApi::class)
1414
class ActiveDatabaseGroupTest {
15-
1615
private val logWriter =
1716
TestLogWriter(
1817
loggable = Severity.Debug,

0 commit comments

Comments
 (0)