mirror of
https://github.com/NixOS/nix.git
synced 2025-12-05 16:41:01 +01:00
topoSort: Optimize templating
- No `std::function` overhead - Don't copy if not necessary Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
This commit is contained in:
parent
0903b0aa7d
commit
13b4512cbe
4 changed files with 42 additions and 40 deletions
|
|
@ -313,13 +313,13 @@ MissingPaths Store::queryMissing(const std::vector<DerivedPath> & targets)
|
|||
|
||||
StorePaths Store::topoSortPaths(const StorePathSet & paths)
|
||||
{
|
||||
auto result = topoSort(paths, {[&](const StorePath & path) {
|
||||
try {
|
||||
return queryPathInfo(path)->references;
|
||||
} catch (InvalidPath &) {
|
||||
return StorePathSet();
|
||||
}
|
||||
}});
|
||||
auto result = topoSort(paths, [&](const StorePath & path) {
|
||||
try {
|
||||
return queryPathInfo(path)->references;
|
||||
} catch (InvalidPath &) {
|
||||
return StorePathSet();
|
||||
}
|
||||
});
|
||||
|
||||
return std::visit(
|
||||
overloaded{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue