File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242function print (io:: IO , xs... )
4343 lock (io)
4444 try
45- foreach (Fix1 (print, io), xs)
45+ for x in xs
46+ print (io, x)
47+ end
4648 finally
4749 unlock (io)
4850 end
@@ -136,20 +138,32 @@ function print_to_string(xs...)
136138 if isempty (xs)
137139 return " "
138140 end
139- siz = sum (_str_sizehint, xs; init = 0 )
141+ siz:: Int = 0
142+ for x in xs
143+ siz += _str_sizehint (x)
144+ end
145+ # specialized for performance reasons
140146 s = IOBuffer (sizehint= siz)
141- print (s, xs... )
147+ for x in xs
148+ print (s, x)
149+ end
142150 String (_unsafe_take! (s))
143151end
144152
145153function string_with_env (env, xs... )
146154 if isempty (xs)
147155 return " "
148156 end
149- siz = sum (_str_sizehint, xs; init = 0 )
157+ siz:: Int = 0
158+ for x in xs
159+ siz += _str_sizehint (x)
160+ end
161+ # specialized for performance reasons
150162 s = IOBuffer (sizehint= siz)
151163 env_io = IOContext (s, env)
152- print (env_io, xs... )
164+ for x in xs
165+ print (env_io, x)
166+ end
153167 String (_unsafe_take! (s))
154168end
155169
You can’t perform that action at this time.
0 commit comments