Skip to content

Commit

Permalink
Make length call on Object more accurate. (#217)
Browse files Browse the repository at this point in the history
Partial fix for #216. This at least fixes the part where we were inaccurately reporting the length of the object with dupliate keys.
  • Loading branch information
quinnj authored May 8, 2022
1 parent 92b7e6b commit 35a5d67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JSON3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $(String(buf[max(1, pos-25):min(end, pos+25)]))
@enum Error UnexpectedEOF ExpectedOpeningObjectChar ExpectedOpeningQuoteChar ExpectedOpeningArrayChar ExpectedClosingArrayChar ExpectedComma ExpectedSemiColon ExpectedNewline InvalidChar InvalidNumber

# AbstractDict interface
Base.length(obj::Object) = length(getinds(obj))
Base.length(obj::Object) = getnontypemask(gettape(obj)[2])

function populateinds!(x::Object)
inds = getinds(x)
Expand Down

0 comments on commit 35a5d67

Please sign in to comment.