mirror of
https://github.com/NixOS/nix.git
synced 2025-11-25 11:49:35 +01:00
mountInput(): Optimize getting the NAR hash for real store paths
This commit is contained in:
parent
fca291afc3
commit
6477d7c2ca
1 changed files with 7 additions and 3 deletions
|
|
@ -81,9 +81,13 @@ StorePath EvalState::mountInput(
|
|||
|
||||
auto getNarHash = [&]()
|
||||
{
|
||||
if (!_narHash)
|
||||
// FIXME: use fetchToStore to make it cache this
|
||||
_narHash = accessor->hashPath(CanonPath::root);
|
||||
if (!_narHash) {
|
||||
if (store->isValidPath(storePath))
|
||||
_narHash = store->queryPathInfo(storePath)->narHash;
|
||||
else
|
||||
// FIXME: use fetchToStore to make it cache this
|
||||
_narHash = accessor->hashPath(CanonPath::root);
|
||||
}
|
||||
return _narHash;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue