The Wayback Machine - https://web.archive.org/web/20200918063747/https://github.com/buger/jsonparser/pull/181
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix #174, EachKey missing nested extractions #181

Merged
merged 1 commit into from Dec 4, 2019

Conversation

@floren
Copy link
Contributor

floren commented Nov 19, 2019

If you are trying to extract "foo" and "foo.bar" from '{"foo": {"bar": 1}}' with EachKey, the parser would find the "foo" key, extract the contents ('{"bar": 1}'), and then add the offset of
that extraction to the current index. This means it would never find the "bar" key. This change simply eliminates the adding of the offset.

This appears to fix #174 and includes a test for it.

Description: What this PR does

Benchmark before change:
Benchmarks are broken.

from '{"foo": {"bar": 1}}' with EachKey, the parser would find the "foo"
key, extract the contents ('{"bar": 1}'), and then *add the offset* of
that extraction to the current index. This means it would never find the
"bar" key. This change simply eliminates the adding of the offset.
@buger buger merged commit 1a29609 into buger:master Dec 4, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.