We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97972d3 commit d40eeffCopy full SHA for d40eeff
src/utils.jl
@@ -170,9 +170,12 @@ module Utils
170
end
171
172
function Base.String(x::StaticString{T,N}) where {T,N}
173
- i = findfirst(iszero, x.codeunits)
174
- j = i === nothing ? N : i - 1
175
- cs = T[x.codeunits[i] for i in 1:j]
+ ts = x.codeunits
+ n = N
+ while n > 0 && iszero(ts[n])
176
+ n -= 1
177
+ end
178
+ cs = T[ts[i] for i in 1:n]
179
transcode(String, cs)
180
181
0 commit comments