Skip to content

Commit 1570acd

Browse files
committed
minor ExprSplitter optimization
1 parent f9bdad5 commit 1570acd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/construct.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ See [`Frame(mod::Module, ex::Expr)`](@ref) for more information about frame crea
438438
"""
439439
mutable struct ExprSplitter
440440
# Non-mutating fields
441-
stack::Vector{Tuple{Module,Expr}} # mod[i] is module of evaluation for
442-
index::Vector{Int} # next-to-handle argument index for :block or :toplevel exprs
441+
const stack::Vector{Tuple{Module,Expr}} # mod[i] is module of evaluation for
442+
const index::Vector{Int} # next-to-handle argument index for :block or :toplevel exprs
443443
# Mutating fields
444444
lnn::Union{LineNumberNode,Nothing}
445445
end
@@ -508,7 +508,7 @@ function queuenext!(iter::ExprSplitter)
508508
mod = Base.root_module(id)::Module
509509
else
510510
loc = firstline(ex)
511-
mod = Core.eval(mod, Expr(:module, ex.args[1], ex.args[2], Expr(:block, loc, loc)))::Module
511+
mod = Core.eval(mod, Expr(:module, ex.args[1], newname, Expr(:block, loc, loc)))::Module
512512
end
513513
end
514514
# We've handled the module declaration, remove it and queue the body

0 commit comments

Comments
 (0)