From 11f4a5bc7eca8a4cca2ae9f3d83b69cd497933f8 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 3 May 2024 22:53:24 +0200 Subject: 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 --- src/libutil/hash.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libutil/hash.cc') diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 006b5000c..822fa150e 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -324,7 +324,7 @@ Hash hashString(HashType ht, std::string_view s) Hash hashFile(HashType ht, const Path & path) { HashSink sink(ht); - readFile(path, sink); + readFileSource(path)->drainInto(sink); return sink.finish().first; } -- cgit v1.2.3