Skip to content

Commit

Permalink
improve inferrability of prune_graph! (#3202)
Browse files Browse the repository at this point in the history
* improve inferrability of `prune_graph!`

This fixes some invalidations when loading HDF5.jl

* update comment

Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
(cherry picked from commit 0d5230b)
  • Loading branch information
ranocha authored and KristofferC committed Sep 21, 2022
1 parent 7b2f198 commit 4fc3e25
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Resolve/graphtype.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,12 @@ 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]

# explicitly writing out the following loop since the generator equivalent caused type inference failure
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 new constraints are all going to be `true`, except possibly
# for the "uninstalled" state, which we copy over from the old
Expand Down

0 comments on commit 4fc3e25

Please sign in to comment.