Skip to content

Commit 625ab2f

Browse files
authored
Use codeunits over unsafe_wrap (#239)
1 parent bf4aac5 commit 625ab2f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/longsequences/constructors.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ function LongSequence{A}(s::Union{String, SubString{String}}, ::AlphabetCode) wh
5656
end
5757

5858
function LongSequence{A}(s::Union{String, SubString{String}}, ::AsciiAlphabet) where {A<:Alphabet}
59-
v = GC.@preserve s unsafe_wrap(Vector{UInt8}, pointer(s), ncodeunits(s))
60-
seq = LongSequence{A}(undef, length(v))
61-
return encode_chunks!(seq, 1, v, 1, length(v))
59+
seq = LongSequence{A}(undef, ncodeunits(s))
60+
return encode_chunks!(seq, 1, codeunits(s), 1, ncodeunits(s))
6261
end
6362

6463
function LongSequence{A}(

0 commit comments

Comments
 (0)