From 35a5d6753a27cf397763125a77c9ddd94fd4e73d Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Sat, 7 May 2022 22:57:09 -0600 Subject: [PATCH] Make length call on Object more accurate. (#217) Partial fix for #216. This at least fixes the part where we were inaccurately reporting the length of the object with dupliate keys. --- src/JSON3.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JSON3.jl b/src/JSON3.jl index 60904e1..645f740 100644 --- a/src/JSON3.jl +++ b/src/JSON3.jl @@ -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)