Skip to content

refactor: use slices.Backward for reverse slice iteration - #7010

Open
iliya-vidrush wants to merge 1 commit into
anomalyco:devfrom
iliya-vidrush:refactor/slices-backward
Open

iliya-vidrush wants to merge 1 commit into
anomalyco:devfrom
iliya-vidrush:refactor/slices-backward

Conversation

@iliya-vidrush

Copy link
Copy Markdown

Summary

  • Replace the manual for i := len(s) - 1; i >= 0; i-- loops in checkProviderUpgrade and untrack with slices.Backward.
  • Mechanical only: both sites keep reverse traversal, and untrack keeps its swap-with-last removal.

Validation

  • go build ./..., go vet, and go test ./pkg/process/... ./pkg/project/ pass.

Replace the manual `for i := len(s) - 1; i >= 0; i--` loops in
provider-upgrade detection and process untracking with
`slices.Backward`, dropping the index bookkeeping while keeping the
reverse traversal both sites depend on.

No behavior change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant