File tree 2 files changed +16
-16
lines changed
commonMain/kotlin/com/powersync/db
commonTest/kotlin/com/powersync/db
2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -35,30 +35,31 @@ internal class ActiveDatabaseGroup(
35
35
}
36
36
}
37
37
38
- internal open class GroupsCollection : Synchronizable () {
38
+ internal open class GroupsCollection : Synchronizable () {
39
39
internal val allGroups = mutableListOf<ActiveDatabaseGroup >()
40
40
41
41
private fun findGroup (
42
42
warnOnDuplicate : Logger ,
43
43
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 }
53
58
}
54
59
55
- if (resolvedGroup.refCount++ != 0 ) {
56
- warnOnDuplicate.w { multipleInstancesMessage }
60
+ resolvedGroup
57
61
}
58
62
59
- resolvedGroup
60
- }
61
-
62
63
internal fun referenceDatabase (
63
64
warnOnDuplicate : Logger ,
64
65
identifier : String ,
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import kotlin.test.assertNotNull
12
12
13
13
@OptIn(ExperimentalKermitApi ::class )
14
14
class ActiveDatabaseGroupTest {
15
-
16
15
private val logWriter =
17
16
TestLogWriter (
18
17
loggable = Severity .Debug ,
You can’t perform that action at this time.
0 commit comments