Skip to content

Type piracy with Base.readuntil #1021

Description

@mortenpi

HTTP.jl/src/IOExtras.jl

Lines 114 to 124 in a3a5768

function Base.readuntil(buf::IOBuffer,
find_delimiter::F #= Vector{UInt8} -> Int =#
)::ByteView where {F <: Function}
l = find_delimiter(view(buf.data, buf.ptr:buf.size))
if l == 0
return nobytes
end
bytes = view(buf.data, buf.ptr:buf.ptr + l - 1)
buf.ptr += l
return bytes
end

This could be causing some issues for us in our use case, although that needs a bit more investigation. But regardless, it might be a good idea to try to get rid of it, just in case?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions