1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-23 17:31:08 +01:00

Merge pull request #14835 from Zaczero/zaczero/reserve-perf

Fix reserve pitfall in printString
This commit is contained in:
Sergei Zimmerman 2025-12-19 02:06:07 +00:00 committed by GitHub
commit f1f99b6598
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -523,7 +523,6 @@ Derivation parseDerivation(
*/
static void printString(std::string & res, std::string_view s)
{
res.reserve(res.size() + s.size() * 2 + 2);
res += '"';
static constexpr auto chunkSize = 1024;
std::array<char, 2 * chunkSize + 2> buffer;