diff options
author | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2023-04-07 09:16:40 +0200 |
---|---|---|
committer | Théophane Hufschmitt <theophane.hufschmitt@tweag.io> | 2023-04-07 09:21:50 +0200 |
commit | 214f1d67910e491e0bd7e1f09f0623fdffd82d48 (patch) | |
tree | d605b28e1ddffa733d1e13173f9b39dab139af06 /src/libutil/hash.cc | |
parent | 91856396317995aa38dc7244357596b8de27f937 (diff) |
Rename and protect `BufferedSink::write`
The `write` name is ambiguous and could lead to some funny bugs like
https://github.com/NixOS/nix/pull/8173#issuecomment-1500009480. So
rename it to the more explicit `writeUnbuffered`.
Besides, this method shouldn't be (and isn't) used outside of the class
implementation, so mark it `protected`.
This makes it more symetrical to `BufferedSource` which uses a
`protected readUnbuffered` method.
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r-- | src/libutil/hash.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 5735e4715..0c8f5727d 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -343,7 +343,7 @@ HashSink::~HashSink() delete ctx; } -void HashSink::write(std::string_view data) +void HashSink::writeUnbuffered(std::string_view data) { bytes += data.size(); update(ht, *ctx, data); |