mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +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 = [&]()
|
auto getNarHash = [&]()
|
||||||
{
|
{
|
||||||
if (!_narHash)
|
if (!_narHash) {
|
||||||
// FIXME: use fetchToStore to make it cache this
|
if (store->isValidPath(storePath))
|
||||||
_narHash = accessor->hashPath(CanonPath::root);
|
_narHash = store->queryPathInfo(storePath)->narHash;
|
||||||
|
else
|
||||||
|
// FIXME: use fetchToStore to make it cache this
|
||||||
|
_narHash = accessor->hashPath(CanonPath::root);
|
||||||
|
}
|
||||||
return _narHash;
|
return _narHash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue