Skip to content

Commit 9736a70

Browse files
committed
chore: duplicate code in OTBranch.operationsAndTree and .getPendingChanges()
1 parent 98e4428 commit 9736a70

File tree

1 file changed

+1
-12
lines changed
  • model-datastructure/src/commonMain/kotlin/org/modelix/model/operations

1 file changed

+1
-12
lines changed

model-datastructure/src/commonMain/kotlin/org/modelix/model/operations/OTBranch.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,7 @@ class OTBranch(
4444
}
4545

4646
@Deprecated("renamed to getPendingChanges()", ReplaceWith("getPendingChanges()"))
47-
val operationsAndTree: Pair<List<IAppliedOperation>, ITree>
48-
get() {
49-
return runSynchronized(completedChanges) {
50-
val result = when (completedChanges.size) {
51-
0 -> emptyList<IAppliedOperation>() to computeReadT { it.tree }
52-
1 -> completedChanges[0]
53-
else -> completedChanges.flatMap { it.first } to completedChanges.last().second
54-
}
55-
completedChanges.clear()
56-
result
57-
}
58-
}
47+
val operationsAndTree: Pair<List<IAppliedOperation>, ITree> get() = getPendingChanges()
5948

6049
/**
6150
* @return the operations applied to the branch since the last call of this function and the resulting ITree.

0 commit comments

Comments
 (0)