mirror of
https://github.com/NixOS/nix.git
synced 2025-12-03 15:40:59 +01:00
Make verifyAllValidPaths more functional
return map rather than mutate one passed in by reference
This commit is contained in:
parent
73c9fc7ab1
commit
6b297e5895
4 changed files with 19 additions and 12 deletions
|
|
@ -243,19 +243,21 @@ void LocalOverlayStore::optimiseStore()
|
|||
}
|
||||
|
||||
|
||||
bool LocalOverlayStore::verifyAllValidPaths(RepairFlag repair, StorePathSet & validPaths)
|
||||
std::pair<bool, StorePathSet> LocalOverlayStore::verifyAllValidPaths(RepairFlag repair)
|
||||
{
|
||||
StorePathSet done;
|
||||
bool errors = false;
|
||||
|
||||
auto existsInStoreDir = [&](const StorePath & storePath) {
|
||||
return pathExists(realStoreDir.get() + "/" + storePath.to_string());
|
||||
};
|
||||
|
||||
bool errors = false;
|
||||
StorePathSet validPaths;
|
||||
|
||||
for (auto & i : queryAllValidPaths())
|
||||
verifyPath(i, existsInStoreDir, done, validPaths, repair, errors);
|
||||
|
||||
return errors;
|
||||
return { errors, validPaths };
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue