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:
parent
21a251be5f
commit
7998508a40
2 changed files with 5 additions and 1 deletions
|
|
@ -1171,6 +1171,8 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
|
||||||
|
|
||||||
void createRegularFile(const CanonPath & path, std::function<void(CreateRegularFileSink &)> func) override
|
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
|
/* 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,
|
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. */
|
we switch to writing directly to a Git write stream. */
|
||||||
|
|
@ -1334,6 +1336,8 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
|
||||||
auto repo(repoPool.get());
|
auto repo(repoPool.get());
|
||||||
|
|
||||||
[&](this const auto & visit, Directory & node) -> void {
|
[&](this const auto & visit, Directory & node) -> void {
|
||||||
|
checkInterrupt();
|
||||||
|
|
||||||
// Write the child directories.
|
// Write the child directories.
|
||||||
for (auto & child : node.children)
|
for (auto & child : node.children)
|
||||||
if (auto dir = std::get_if<Directory>(&child.second.file))
|
if (auto dir = std::get_if<Directory>(&child.second.file))
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ public:
|
||||||
std::vector<ref<R>> clear()
|
std::vector<ref<R>> clear()
|
||||||
{
|
{
|
||||||
auto state_(state.lock());
|
auto state_(state.lock());
|
||||||
return std::move(state_->idle);
|
return std::exchange(state_->idle, {});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue