Skip to content

JSONValue should represent integers with a string #17

Description

@schveiguy

Instead of storing the json number value as an integer or float, store it as a string, and then let the user decide how to read it.

This could potentially cause problems if the json stream is transient, meaning we would have to make a copy of the string.

Potentially, if we know the string is an integer and fits within an int, then we could eagerly parse it.

Otherwise, we can store numbers using a SSO string. Currently the union contains a string, which is 16 bytes. So a 16 byte character array is possible without allocating.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions