Index tier history sources lazily
This commit is contained in:
@@ -16,6 +16,7 @@ func projectTierHistoryApplications(applications []historyApplication, operation
|
||||
projected := cloneHistoryApplications(applications)
|
||||
for index, original := range applications {
|
||||
application := &projected[index]
|
||||
var originalLookup *documentLookup
|
||||
if path, found := projectSequenceOperationPath(original.path, projections); found {
|
||||
application.path = path
|
||||
}
|
||||
@@ -25,7 +26,10 @@ func projectTierHistoryApplications(applications []historyApplication, operation
|
||||
if !active || operation.mode != sequenceHistoryMapped {
|
||||
continue
|
||||
}
|
||||
value, found := documentAtPath(original.value, source.path)
|
||||
if originalLookup == nil {
|
||||
originalLookup = buildDocumentLookup(original.value)
|
||||
}
|
||||
value, found := documentAtPathWithLookup(original.value, source.path, originalLookup)
|
||||
if !found || value.Kind != document.Sequence {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user