Reuse cached pointers when ordering resolution changes

This commit is contained in:
2026-11-02 17:40:12 +00:00
parent e878ce51ff
commit 795cc2f379
3 changed files with 31 additions and 18 deletions

View File

@@ -2,8 +2,9 @@ package engine
import (
"cmp"
"go.maximumdirect.net/configkit/internal/document"
"slices"
"go.maximumdirect.net/configkit/internal/document"
)
type documentDeltaKind uint8
@@ -24,6 +25,10 @@ type documentDelta struct {
func compareConfigurationValues(before, after *document.Node) []documentDelta {
var deltas []documentDelta
compareConfigurationValue(before, after, Path{}, &deltas)
return sortDocumentDeltas(deltas)
}
func sortDocumentDeltas(deltas []documentDelta) []documentDelta {
type orderedDelta struct {
delta documentDelta
pointer string