Skip to content

cli/command/image: getPossibleChips: simplify#6873

Merged
vvoland merged 1 commit intodocker:masterfrom
thaJeztah:simplify_chips
Apr 2, 2026
Merged

cli/command/image: getPossibleChips: simplify#6873
vvoland merged 1 commit intodocker:masterfrom
thaJeztah:simplify_chips

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Extract the check to a closure that filters in-place, and run the check in a single loop.

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

Extract the check to a closure that filters in-place, and
run the check in a single loop.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 29.3.1 milestone Mar 20, 2026
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Mar 20, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/image/tree.go 87.50% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors getPossibleChips in the image tree command to simplify chip discovery while reducing intermediate allocations.

Changes:

  • Replace manual slice copy with slices.Clone(allChips).
  • Extract the “chip match + remove from remaining” logic into an in-place filtering closure.
  • Collapse the previous nested loops into a single pass over each image’s details (top + children) with early-exit when all chips are found.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vvoland vvoland merged commit fbfb69f into docker:master Apr 2, 2026
101 checks passed
@thaJeztah thaJeztah deleted the simplify_chips branch April 2, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants