diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-04-14 10:44:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 10:44:36 +0200 |
commit | 33fc09c2a52ff4e0b51ab922cd7cdca9f7924435 (patch) | |
tree | 6490bd1a238601e48cab26c23971ad6a096dd7e9 /src/libutil/serialise.cc | |
parent | ef0b48377d0fc79d70455c402ed4df4b18cb93dd (diff) | |
parent | 214f1d67910e491e0bd7e1f09f0623fdffd82d48 (diff) |
Merge pull request #8176 from tweag/rename-confusing-write-method
Rename and protect `BufferedSink::write`
Diffstat (limited to 'src/libutil/serialise.cc')
-rw-r--r-- | src/libutil/serialise.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc index 6e53239f5..3d5121a19 100644 --- a/src/libutil/serialise.cc +++ b/src/libutil/serialise.cc @@ -20,7 +20,7 @@ void BufferedSink::operator () (std::string_view data) buffer size. */ if (bufPos + data.size() >= bufSize) { flush(); - write(data); + writeUnbuffered(data); break; } /* Otherwise, copy the bytes to the buffer. Flush the buffer @@ -38,7 +38,7 @@ void BufferedSink::flush() if (bufPos == 0) return; size_t n = bufPos; bufPos = 0; // don't trigger the assert() in ~BufferedSink() - write({buffer.get(), n}); + writeUnbuffered({buffer.get(), n}); } @@ -48,7 +48,7 @@ FdSink::~FdSink() } -void FdSink::write(std::string_view data) +void FdSink::writeUnbuffered(std::string_view data) { written += data.size(); try { |