aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-13 14:47:53 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-13 14:51:17 +0000
commit85aacbee64680e60b22e8a729756b0a3882f8b8f (patch)
tree10388e457650366ed00a3c7f1763d10227ac40f9 /src/libstore/local-store.cc
parent859cd4acea8feadcc0b080ec1a75891e6277339c (diff)
Use `TeeSink` and `TeeSouce` in a few more places
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 3c66a4dfd..e552bdc59 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -1021,11 +1021,7 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
else
hashSink = std::make_unique<HashModuloSink>(htSHA256, std::string(info.path.hashPart()));
- LambdaSource wrapperSource([&](unsigned char * data, size_t len) -> size_t {
- size_t n = source.read(data, len);
- (*hashSink)(data, n);
- return n;
- });
+ TeeSource wrapperSource { source, *hashSink };
restorePath(realPath, wrapperSource);