mirror of
https://github.com/NixOS/nix
synced 2025-06-29 02:11:15 +02:00
withBuffer: avoid allocating a std::function
This commit is contained in:
parent
55c58580be
commit
6dd271b7b4
2 changed files with 5 additions and 2 deletions
|
@ -273,7 +273,7 @@ Derivation parseDerivation(const Store & store, std::string && s, std::string_vi
|
|||
static void printString(string & res, std::string_view s)
|
||||
{
|
||||
size_t bufSize = s.size() * 2 + 2;
|
||||
withBuffer<void, char>(bufSize, [&](char buf[]) {
|
||||
withBuffer(bufSize, [&](char *buf) {
|
||||
char * p = buf;
|
||||
*p++ = '"';
|
||||
for (auto c : s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue