File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 11# This file is a part of Julia. License is MIT: https://julialang.org/license
22
33function _join_preserve_annotations (iterator, args... )
4- if _isannotated (eltype (iterator)) || any (_isannotated, args)
4+ if isconcretetype (eltype (iterator)) && ! _isannotated (eltype (iterator)) && ! any (_isannotated, args)
5+ sprint (join, iterator, args... )
6+ else
57 io = AnnotatedIOBuffer ()
68 join (io, iterator, args... )
7- read (seekstart (io), AnnotatedString{String})
8- else
9- sprint (join, iterator, args... )
9+ # If we know (from compile time information, or dynamically in the case
10+ # of iterators with a non-concrete eltype), that the result is annotated
11+ # in nature, we extract an `AnnotatedString`, otherwise we just extract
12+ # a plain `String` from `io`.
13+ if isconcretetype (eltype (iterator)) || ! isempty (io. annotations)
14+ read (seekstart (io), AnnotatedString{String})
15+ else
16+ String (take! (io. io))
17+ end
1018 end
1119end
1220
You can’t perform that action at this time.
0 commit comments