Closed xperiandri closed 3 years ago
Unfortunately, I was not managed to design changes that would allow doing ValueEquals
because readExternalTag
requires reading a field name. But all the other cases operate with JsonElement and its value.
Hence I had to get a string instance.
@Tarmil could you have a look?
@Tarmil
I've been pretty busy this week but I'll take a look this weekend.
This looks pretty good! I was unsure whether saving and restoring a Utf8JsonReader
like this would work, but it seems officially supported, so that's nice.
I added some tests, and fixed an issue in the AdjacentTag case. I'll definitely add a flag to determine whether to use it or not, because despite the low allocation we're still re-parsing the object, and some people may want to ensure they don't do that. But I think I'll make it enabled by default.
Cool! Thanks!
@Tarmil is there something left preventing this to be merged?
Just my schedule 🙂 I'll add the flag and release it now.
I create a snapshot of a reader (a copy of structure) and parse it into a
JsonDocument
(which is a lazy operation) and do a union case lookup. I have not added new tests but played with modification of existing (not committed) so add tests as appropriate.Fixes #93