Skip to content

Commit a83a0e6

Browse files
authored
Minor inference improvements in stdlibs (#46561)
Since Julia unfortuantely still cannot propagate information from immutable fields loaded twice (see #39888, #41199), these kind of changes are necessary to achieve type stability.
1 parent 5fe93ee commit a83a0e6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stdlib/REPL/src/REPL.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ mutable struct LineEditREPL <: AbstractREPL
467467
in_help,envcolors,false,nothing, opts, nothing, Tuple{String,Int}[])
468468
end
469469
end
470-
outstream(r::LineEditREPL) = r.t isa TTYTerminal ? r.t.out_stream : r.t
470+
outstream(r::LineEditREPL) = (t = r.t; t isa TTYTerminal ? t.out_stream : t)
471471
specialdisplay(r::LineEditREPL) = r.specialdisplay
472472
specialdisplay(r::AbstractREPL) = nothing
473473
terminal(r::LineEditREPL) = r.t

stdlib/Serialization/src/Serialization.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ function serialize_mod_names(s::AbstractSerializer, m::Module)
364364
p = parentmodule(m)
365365
if p === m || m === Base
366366
key = Base.root_module_key(m)
367-
serialize(s, key.uuid === nothing ? nothing : key.uuid.value)
367+
uuid = key.uuid
368+
serialize(s, uuid === nothing ? nothing : uuid.value)
368369
serialize(s, Symbol(key.name))
369370
else
370371
serialize_mod_names(s, p)

0 commit comments

Comments
 (0)