diff options
author | eldritch horrors <pennae@lix.systems> | 2024-05-03 22:53:24 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-06-19 10:50:12 +0000 |
commit | 11f4a5bc7eca8a4cca2ae9f3d83b69cd497933f8 (patch) | |
tree | b991157e020697bb4f05ad4629298b183cb5ed61 /src/nix/hash.cc | |
parent | 67f778670c085615470b67eb3c54885b8c2d482e (diff) |
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
Diffstat (limited to 'src/nix/hash.cc')
-rw-r--r-- | src/nix/hash.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix/hash.cc b/src/nix/hash.cc index 9feca9345..66c5516e7 100644 --- a/src/nix/hash.cc +++ b/src/nix/hash.cc @@ -85,7 +85,7 @@ struct CmdHashBase : Command switch (mode) { case FileIngestionMethod::Flat: - readFile(path, *hashSink); + readFileSource(path)->drainInto(*hashSink); break; case FileIngestionMethod::Recursive: dumpPath(path, *hashSink); |