From b47a4940dc130e50795254f877a17a766be7d2fc Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:57:37 +0200 Subject: [PATCH] Improve printing of several arguments --- base/strings/io.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/strings/io.jl b/base/strings/io.jl index 754e058cd2f54..ea374db9ae109 100644 --- a/base/strings/io.jl +++ b/base/strings/io.jl @@ -42,7 +42,7 @@ end function print(io::IO, xs...) lock(io) try - for x in xs + foreach(xs) do x print(io, x) end finally @@ -144,7 +144,7 @@ function print_to_string(xs...) end # specialized for performance reasons s = IOBuffer(sizehint=siz) - for x in xs + foreach(xs) do x print(s, x) end String(_unsafe_take!(s)) @@ -161,7 +161,7 @@ function string_with_env(env, xs...) # specialized for performance reasons s = IOBuffer(sizehint=siz) env_io = IOContext(s, env) - for x in xs + foreach(xs) do x print(env_io, x) end String(_unsafe_take!(s))