Skip to content

Commit f8c7b27

Browse files
committed
Rename lhsOrder and rhsOrder to lhsPEs and rhsPEs
1 parent 1233172 commit f8c7b27

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

typed/merge.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err
180180
}
181181
out := make([]interface{}, 0, outLen)
182182

183-
rhsOrder, observedRHS, rhsErrs := w.indexListPathElements(t, rhs)
183+
rhsPEs, observedRHS, rhsErrs := w.indexListPathElements(t, rhs)
184184
errs = append(errs, rhsErrs...)
185-
lhsOrder, observedLHS, lhsErrs := w.indexListPathElements(t, lhs)
185+
lhsPEs, observedLHS, lhsErrs := w.indexListPathElements(t, lhs)
186186
errs = append(errs, lhsErrs...)
187187

188188
sharedOrder := make([]*fieldpath.PathElement, 0, rLen)
189-
for i := range rhsOrder {
190-
pe := &rhsOrder[i]
189+
for i := range rhsPEs {
190+
pe := &rhsPEs[i]
191191
if _, ok := observedLHS.Get(*pe); ok {
192192
sharedOrder = append(sharedOrder, pe)
193193
}
@@ -199,11 +199,11 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err
199199
sharedOrder = sharedOrder[1:]
200200
}
201201

202-
lLen, rLen = len(lhsOrder), len(rhsOrder)
202+
lLen, rLen = len(lhsPEs), len(rhsPEs)
203203
for lI, rI := 0, 0; lI < lLen || rI < rLen; {
204204
if lI < lLen && rI < rLen {
205-
pe := lhsOrder[lI]
206-
if pe.Equals(rhsOrder[rI]) {
205+
pe := lhsPEs[lI]
206+
if pe.Equals(rhsPEs[rI]) {
207207
// merge LHS & RHS items
208208
lChild, _ := observedLHS.Get(pe)
209209
rChild, _ := observedRHS.Get(pe)
@@ -222,14 +222,14 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err
222222
}
223223
continue
224224
}
225-
if _, ok := observedRHS.Get(pe); ok && nextShared != nil && !nextShared.Equals(lhsOrder[lI]) {
225+
if _, ok := observedRHS.Get(pe); ok && nextShared != nil && !nextShared.Equals(lhsPEs[lI]) {
226226
// shared item, but not the one we want in this round
227227
lI++
228228
continue
229229
}
230230
}
231231
if lI < lLen {
232-
pe := lhsOrder[lI]
232+
pe := lhsPEs[lI]
233233
if _, ok := observedRHS.Get(pe); !ok {
234234
// take LHS item
235235
lChild, _ := observedLHS.Get(pe)
@@ -244,7 +244,7 @@ func (w *mergingWalker) visitListItems(t *schema.List, lhs, rhs value.List) (err
244244
}
245245
if rI < rLen {
246246
// Take the RHS item, merge with matching LHS item if possible
247-
pe := rhsOrder[rI]
247+
pe := rhsPEs[rI]
248248
lChild, _ := observedLHS.Get(pe) // may be nil
249249
rChild, _ := observedRHS.Get(pe)
250250
mergeOut, errs := w.mergeListItem(t, pe, lChild, rChild)

0 commit comments

Comments
 (0)