Repository navigation
Cosmetic cleanups in the BSON writer (stale comment, inconsistent signature) - #5313
Merged
nlohmann merged 1 commit intoJul 27, 2026
Merged
Conversation
Signed-off-by: banaboi <lukebanicevic@gmail.com>
jwnimmer-tri
pushed a commit
to jwnimmer-tri/json
that referenced
this pull request
Sep 21, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two non-functional cleanups in
include/nlohmann/detail/output/binary_writer.hpp:Remove stale
// booleancomment inwrite_bson_entry_header. That functionwrites the header for every BSON element type, not just booleans. The comment is
left over from when the code was boolean-specific.
Change
write_bson_unsignedto takestd::uint64_tinstead ofconst BasicJsonType&.It reached into
j.m_data.m_value.number_unsignedthree times, while every sibling(
write_bson_boolean,write_bson_double,write_bson_integer,write_bson_string)takes the plain value. The
BasicJsonTypeparameter was only needed as diagnosticcontext for the
out_of_range.407throw that Making Code cleaner #4286 removed, so it no longer earnsits keep. The call site now reads like its neighbours.
While there, fixed the doc comment on the adjacent
calc_bson_unsigned_size, which stillreferred to "the unsigned integer in
@a j" despite already taking avalueparameter.No behaviour change.
Closes #5312
make amalgamate.Read the Contribution Guidelines for detailed information.