libutil: return a source from readFile

don't consume a sink, return a source instead. the only reason to not do
this is a very slight reduction in dynamic allocations, but since we are
going to *at least* do disk io that will not be a lot of overhead anyway

Change-Id: Iae2f879ec64c3c3ac1d5310eeb6a85e696d4614a
This commit is contained in:
eldritch horrors
2024-06-19 10:50:12 +00:00
parent 67f778670c
commit 11f4a5bc7e
10 changed files with 19 additions and 13 deletions
+1 -1
View File
@@ -385,7 +385,7 @@ StorePath BinaryCacheStore::addToStore(
if (method == FileIngestionMethod::Recursive) {
dumpPath(srcPath, sink, filter);
} else {
readFile(srcPath, sink);
readFileSource(srcPath)->drainInto(sink);
}
auto h = sink.finish().first;