Skip to content

Commit b4ee5d1

Browse files
committed
feat: index for efficient history queries
1 parent eb61aca commit b4ee5d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

model-datastructure/src/commonMain/kotlin/org/modelix/datastructures/model/HistoryIndexNode.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ data class HistoryIndexLeafNode(
201201
other.time < time -> otherObj.concatBalanced(self)
202202
other.time > time -> self.concatBalanced(otherObj)
203203
else -> HistoryIndexLeafNode(
204-
versions = (versions.associateBy { it.getHash() } + other.versions.associateBy { it.getHash() }).values.toList(),
204+
versions = (versions + other.versions).distinctBy { it.getHash() }.toList(),
205205
authors = authors + other.authors,
206206
time = time,
207207
).asObject(self.graph).let { IStream.of(it) }

0 commit comments

Comments
 (0)