File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1011,7 +1011,20 @@ function show(io::IO, m::Module)
10111011 if is_root_module (m)
10121012 print (io, nameof (m))
10131013 else
1014- print (io, join (fullname (m)," ." ))
1014+ print_fullname (io, m)
1015+ end
1016+ end
1017+ # The call to print_fullname above was originally `print(io, join(fullname(m),"."))`,
1018+ # which allocates. The method below provides the same behavior without allocating.
1019+ # See https://github.com/JuliaLang/julia/pull/42773 for perf information.
1020+ function print_fullname (io:: IO , m:: Module )
1021+ mp = parentmodule (m)
1022+ if m === Main || m === Base || m === Core || mp === m
1023+ print (io, nameof (m))
1024+ else
1025+ print_fullname (io, mp)
1026+ print (io, ' .' )
1027+ print (io, nameof (m))
10151028 end
10161029end
10171030
You can’t perform that action at this time.
0 commit comments