diff options
author | Carlo Nucera <carlo.nucera@protonmail.com> | 2020-05-28 10:58:22 -0400 |
---|---|---|
committer | Carlo Nucera <carlo.nucera@protonmail.com> | 2020-05-28 10:58:22 -0400 |
commit | 4f597fb901dec55a86a2b29a122b9007177b2358 (patch) | |
tree | c89fff8fb0670fb55eb0c2593b6b48575a2ef914 /src/libutil/serialise.hh | |
parent | 87b32bab05ff91981c8847d66cd5502feb44f3b5 (diff) | |
parent | f60ce4fa207a210e23a1142d3a8ead611526e6e1 (diff) |
Merge branch 'master' of github.com:NixOS/nix into enum-class
Diffstat (limited to 'src/libutil/serialise.hh')
-rw-r--r-- | src/libutil/serialise.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh index 5780c93a6..a04118512 100644 --- a/src/libutil/serialise.hh +++ b/src/libutil/serialise.hh @@ -148,6 +148,9 @@ struct StringSink : Sink { ref<std::string> s; StringSink() : s(make_ref<std::string>()) { }; + explicit StringSink(const size_t reservedSize) : s(make_ref<std::string>()) { + s->reserve(reservedSize); + }; StringSink(ref<std::string> s) : s(s) { }; void operator () (const unsigned char * data, size_t len) override; }; |