Skip to content

incorrect behavior of serialize_impl #668

@vinniefalco

Description

@vinniefalco

serialize_impl is used to serialize JSON into a std::string:

The problem is that line 52 is incorrect, I think it should read:

s.reserve( s.capacity() + 1 );
s.resize( s.capacity() );

otherwise, every 2nd trip through the for loop will be a 1-char write.

Metadata

Metadata

Assignees

Labels

PerformanceRelated to optimization of space or size

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions