1
1
Fork 0
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:
Eelco Dolstra 2025-06-12 16:11:54 +02:00
parent fca291afc3
commit 6477d7c2ca

View file

@ -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;
}; };