plan: compare individual elements if list is same length

Closes #33779
pull/34677/head
Daniel Schmidt 2 years ago
parent 64b311d53a
commit 31bd2b5be0
No known key found for this signature in database
GPG Key ID: 377C3A4D62FBBBE2

@ -35,6 +35,16 @@ func TransformSlice[Input any](before, after []Input, process TransformIndices,
}
func ProcessSlice[Input any](before, after []Input, process ProcessIndices, isObjType IsObjType[Input]) {
// If before and after are the same length we want to compare elements
// on an individual basis
if len(before) == len(after) {
for ix := range before {
process(ix, ix)
}
return
}
lcs := objchange.LongestCommonSubsequence(before, after, func(before, after Input) bool {
return reflect.DeepEqual(before, after)
})

Loading…
Cancel
Save