-
Notifications
You must be signed in to change notification settings - Fork 311
Fix update installing all packages instead of target #2816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,8 @@ func (d *Devbox) Update(ctx context.Context, opts devopt.UpdateOpts) error { | |
| } | ||
| } | ||
|
|
||
| d.packagesBeingUpdated = inputs | ||
|
|
||
|
Comment on lines
+83
to
+84
|
||
| mode := update | ||
| if opts.NoInstall { | ||
| mode = noInstall | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isBeingUpdateddoes a linear scan overd.packagesBeingUpdatedfor every package inpackagesToInstallInStore. When updating all packages this becomes O(n²) and adds avoidable overhead. Consider representing the update targets as amap[string]struct{}/set keyed bypkg.Raw(or building such a set once) so membership checks are O(1).