Skip to content

Commit c11ad07

Browse files
committed
remove unnecessary check on prior element length
1 parent fef2d6a commit c11ad07

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

internal/fwschemadata/value_semantic_equality_set.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ func ValueSemanticEqualitySetElements(ctx context.Context, req ValueSemanticEqua
128128
// Short circuit flag
129129
updatedElements := false
130130

131-
// The underlying loop will mutate priorValueElements to avoid keeping
132-
// duplicate semantically equal elements. Need the original length to avoid a panic
133-
originalPriorElementsLength := len(priorValueElements)
134-
135131
// Loop through proposed elements by delegating to the recursive semantic
136132
// equality logic. This ensures that recursion will catch a further
137133
// underlying element type has its semantic equality logic checked, even if
@@ -140,10 +136,6 @@ func ValueSemanticEqualitySetElements(ctx context.Context, req ValueSemanticEqua
140136
// Ensure new value always contains all of proposed new value
141137
newValueElements[idx] = proposedNewValueElement
142138

143-
if idx >= originalPriorElementsLength {
144-
continue
145-
}
146-
147139
// Loop through all prior value elements and see if there are any semantically equal elements
148140
for pIdx, priorValueElement := range priorValueElements {
149141
elementReq := ValueSemanticEqualityRequest{

0 commit comments

Comments
 (0)