Skip to content

Commit

Permalink
remove unnecessary check on prior element length
Browse files Browse the repository at this point in the history
  • Loading branch information
austinvalle committed Feb 12, 2025
1 parent fef2d6a commit c11ad07
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions internal/fwschemadata/value_semantic_equality_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ func ValueSemanticEqualitySetElements(ctx context.Context, req ValueSemanticEqua
// Short circuit flag
updatedElements := false

// The underlying loop will mutate priorValueElements to avoid keeping
// duplicate semantically equal elements. Need the original length to avoid a panic
originalPriorElementsLength := len(priorValueElements)

// Loop through proposed elements by delegating to the recursive semantic
// equality logic. This ensures that recursion will catch a further
// underlying element type has its semantic equality logic checked, even if
Expand All @@ -140,10 +136,6 @@ func ValueSemanticEqualitySetElements(ctx context.Context, req ValueSemanticEqua
// Ensure new value always contains all of proposed new value
newValueElements[idx] = proposedNewValueElement

if idx >= originalPriorElementsLength {
continue
}

// Loop through all prior value elements and see if there are any semantically equal elements
for pIdx, priorValueElement := range priorValueElements {
elementReq := ValueSemanticEqualityRequest{
Expand Down

0 comments on commit c11ad07

Please sign in to comment.