From d62a9390fcdc0f9e4971e5fab2f667567237b252 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 17 Jan 2022 22:20:05 +0100 Subject: Get rid of std::shared_ptr and ref These were needed back in the pre-C++11 era because we didn't have move semantics. But now we do. --- src/libutil/serialise.hh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/libutil/serialise.hh') diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh index e80fb9ecf..fdd35aa00 100644 --- a/src/libutil/serialise.hh +++ b/src/libutil/serialise.hh @@ -154,12 +154,13 @@ private: /* A sink that writes data to a string. */ struct StringSink : Sink { - ref s; - StringSink() : s(make_ref()) { }; - explicit StringSink(const size_t reservedSize) : s(make_ref()) { - s->reserve(reservedSize); + std::string s; + StringSink() { } + explicit StringSink(const size_t reservedSize) + { + s.reserve(reservedSize); }; - StringSink(ref s) : s(s) { }; + StringSink(std::string && s) : s(std::move(s)) { }; void operator () (std::string_view data) override; }; -- cgit v1.2.3