Skip to content

Commit

Permalink
Fixup: Fake dense array for codeunits of String
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen committed Apr 9, 2024
1 parent ef2eadc commit 5b06af8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base/strings/substring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ convert(::Type{Union{String, SubString{String}}}, s::AbstractString) = convert(S
function _memory_offset(x::CodeUnits{<:Any, <:Union{String, SubString{String}}}, I::Vararg{Any,N}) where {N}
(_to_linear_index(x, I...) - first(LinearIndices(x)))*elsize(x)
end
strides(x::CodeUnits{<:Any, <:Union{String, SubString{String}}}) = (1,)

function String(s::SubString{String})
parent = s.string
Expand Down

0 comments on commit 5b06af8

Please sign in to comment.