Skip to content

Commit 998998c

Browse files
author
Kristoffer Carlsson
authored
get rid of pushvector (#312)
1 parent 0a49736 commit 998998c

File tree

2 files changed

+4
-40
lines changed

2 files changed

+4
-40
lines changed

src/Parser.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ using Mmap
44
using ..Common
55
import Parsers
66

7-
include("pushvector.jl")
8-
97
"""
108
Like `isspace`, but work on bytes and includes only the four whitespace
119
characters defined by the JSON standard: space, tab, line feed, and carriage
@@ -33,9 +31,9 @@ mutable struct StreamingParserState{T <: IO} <: ParserState
3331
io::T
3432
cur::UInt8
3533
used::Bool
36-
utf8array::PushVector{UInt8, Vector{UInt8}}
34+
utf8array::Vector{UInt8}
3735
end
38-
StreamingParserState(io::IO) = StreamingParserState(io, 0x00, true, PushVector{UInt8}())
36+
StreamingParserState(io::IO) = StreamingParserState(io, 0x00, true, UInt8[])
3937

4038
struct ParserContext{DictType, IntType, AllowNanInf, NullValue} end
4139

@@ -318,10 +316,9 @@ end
318316
Parse a float from the given bytes vector, starting at `from` and ending at the
319317
byte before `to`. Bytes enclosed should all be ASCII characters.
320318
"""
321-
float_from_bytes(bytes::PushVector, from::Int, to::Int) = _float_from_bytes(bytes.v, from, to)
322-
float_from_bytes(bytes::MemoryParserState, from::Int, to::Int) = _float_from_bytes(bytes.utf8, from, to)
319+
float_from_bytes(bytes::MemoryParserState, from::Int, to::Int) = float_from_bytes(bytes.utf8, from, to)
323320

324-
function _float_from_bytes(bytes, from::Int, to::Int)::Union{Float64,Nothing}
321+
function float_from_bytes(bytes::Union{String, Vector{UInt8}}, from::Int, to::Int)::Union{Float64,Nothing}
325322
# Would like to use tryparse, but we want it to consume the full input,
326323
# and the version in Parsers does not do this.
327324

src/pushvector.jl

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)