-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
improve inferrability of prune_graph!
#3202
Changes from 1 commit
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 |
---|---|---|
|
@@ -1439,7 +1439,13 @@ function prune_graph!(graph::Graph) | |
return pvers0[vmsk0[1:(end-1)]] | ||
end | ||
new_pvers = [compute_pvers(new_p0) for new_p0 = 1:new_np] | ||
new_vdict = [Dict(vn => v0 for (v0,vn) in enumerate(new_pvers[new_p0])) for new_p0 = 1:new_np] | ||
new_vdict = Vector{Dict{VersionNumber, Int}}(undef, length(new_pvers)) | ||
for new_p0 in eachindex(new_vdict) | ||
new_vdict[new_p0] = Dict(vn => v0 for (v0,vn) in enumerate(new_pvers[new_p0])) | ||
end | ||
# The code above is essentially equivalent to | ||
# new_vdict = [Dict(vn => v0 for (v0,vn) in enumerate(new_pvers[new_p0])) for new_p0 = 1:new_np] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this whole chunk can used be written as
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will be AFK in the next few days. Could you please make the changes you suggested? Otherwise, I will revisit this some time in October. |
||
# but leads to improved type stability and reduced invalidations. | ||
|
||
# The new constraints are all going to be `true`, except possibly | ||
# for the "uninstalled" state, which we copy over from the old | ||
|
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.
Wouldn't
also work?