1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-23 17:31:08 +01:00

Apply suggestions from code review

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
This commit is contained in:
Eelco Dolstra 2025-12-17 12:50:33 +01:00
parent 21a251be5f
commit 7998508a40
2 changed files with 5 additions and 1 deletions

View file

@ -1171,6 +1171,8 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
void createRegularFile(const CanonPath & path, std::function<void(CreateRegularFileSink &)> func) override
{
checkInterrupt();
/* Multithreaded blob writing. We read the incoming file data into memory and asynchronously write it to a Git
blob object. However, to avoid unbounded memory usage, if the amount of data in flight exceeds a threshold,
we switch to writing directly to a Git write stream. */
@ -1334,6 +1336,8 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
auto repo(repoPool.get());
[&](this const auto & visit, Directory & node) -> void {
checkInterrupt();
// Write the child directories.
for (auto & child : node.children)
if (auto dir = std::get_if<Directory>(&child.second.file))

View file

@ -215,7 +215,7 @@ public:
std::vector<ref<R>> clear()
{
auto state_(state.lock());
return std::move(state_->idle);
return std::exchange(state_->idle, {});
}
};