Skip to content

Commit

Permalink
Fix a few issues found by JET
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed May 30, 2024
1 parent 72923fe commit 68ea292
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ function continuous_control!(
if controls_pump
for id in outflow_ids(graph, controlled_node_id)
if id in fractional_flow.node_id
after_ff_id = outflow_ids(graph, id)
ff_idx = findsorted(fractional_flow, id)
ff_idx = findsorted(fractional_flow.node_id, id)
after_ff_id = fractional_flow.outflow_edge[ff_idx].edge[2]

Check warning on line 255 in core/src/solve.jl

View check run for this annotation

Codecov / codecov/patch

core/src/solve.jl#L254-L255

Added lines #L254 - L255 were not covered by tests
flow_rate_fraction = fractional_flow.fraction[ff_idx] * flow_rate
flow[id, after_ff_id] = flow_rate_fraction

Expand Down
4 changes: 2 additions & 2 deletions core/src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function pkgversion(m::Module)::VersionNumber
# If it returns `nothing`, we try a different way
rootmodule = Base.moduleroot(m)
pkg = Base.PkgId(rootmodule)
pkgorigin = get(Base.pkgorigins, pkg, nothing)
pkgorigin = Base.pkgorigins[pkg]

Check warning on line 10 in core/src/util.jl

View check run for this annotation

Codecov / codecov/patch

core/src/util.jl#L10

Added line #L10 was not covered by tests
return pkgorigin.version
end

Expand Down Expand Up @@ -688,7 +688,7 @@ end
function get_influx(basin::Basin, node_id::NodeID)::Float64
has_index, basin_idx = id_index(basin.node_id, node_id)
if !has_index
error("Sum of vertical fluxes requested for non-basin $id.")
error("Sum of vertical fluxes requested for non-basin $node_id.")

Check warning on line 691 in core/src/util.jl

View check run for this annotation

Codecov / codecov/patch

core/src/util.jl#L691

Added line #L691 was not covered by tests
end
return get_influx(basin, basin_idx)
end
Expand Down

0 comments on commit 68ea292

Please sign in to comment.