forked from serde-rs/json
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-allocate capacity for maps in json! macro.
Attempt to address issue serde-rs#810. This implementation works by expanding the contents of the map twice, first to increment a capacity variable for each element, then actually inserting them. In debug mode, this implementation does not appear to optimize out the incrementations of the capacity variable, so it is likely not a good solution.
- Loading branch information
Showing
1 changed file
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters