Skip to content

Commit 9bb5a40

Browse files
authored
Remove unnecessary manifest lookup in apply_force_latest_compatible_version! (#2603)
1 parent 326f5e7 commit 9bb5a40

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/Operations.jl

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,33 +1843,32 @@ end
18431843
function apply_force_latest_compatible_version!(ctx::Types.Context;
18441844
target_name = nothing,
18451845
allow_earlier_backwards_compatible_versions::Bool = true)
1846-
direct_deps = load_direct_deps(ctx.env)
1847-
direct_deps_uuids = [dep.uuid for dep in direct_deps]
1848-
uuid_list = filter(!is_stdlib, direct_deps_uuids)
1849-
for uuid in uuid_list
1850-
apply_force_latest_compatible_version!(
1851-
ctx,
1852-
uuid;
1853-
target_name,
1854-
allow_earlier_backwards_compatible_versions,
1855-
)
1846+
deps_from_env = load_direct_deps(ctx.env)
1847+
deps = [(; name = x.name, uuid = x.uuid) for x in deps_from_env]
1848+
for dep in deps
1849+
if !is_stdlib(dep.uuid)
1850+
apply_force_latest_compatible_version!(
1851+
ctx,
1852+
dep;
1853+
target_name,
1854+
allow_earlier_backwards_compatible_versions,
1855+
)
1856+
end
18561857
end
18571858
return nothing
18581859
end
18591860

18601861
function apply_force_latest_compatible_version!(ctx::Types.Context,
1861-
uuid::Base.UUID;
1862-
target_name= nothing,
1862+
dep::NamedTuple{(:name, :uuid), Tuple{String, Base.UUID}};
1863+
target_name = nothing,
18631864
allow_earlier_backwards_compatible_versions::Bool = true)
1864-
dep = ctx.env.manifest[uuid]
1865-
name = dep.name
1866-
active_version = dep.version
1865+
name, uuid = dep
18671866
has_compat = haskey(ctx.env.project.compat, name)
18681867
if !has_compat
18691868
if name != target_name
18701869
@warn(
18711870
"Dependency does not have a [compat] entry",
1872-
name, uuid, active_version, target_name,
1871+
name, uuid, target_name,
18731872
)
18741873
end
18751874
return nothing

0 commit comments

Comments
 (0)