1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

Optimize DummyStore::isValidPathUncached

See the API docs for the rationale of why this is needed.
This commit is contained in:
John Ericson 2025-10-21 11:37:14 -04:00
parent 2d4c7d3d03
commit 34de68d260

View file

@ -168,6 +168,15 @@ struct DummyStoreImpl : DummyStore
callback(nullptr);
}
/**
* Do this to avoid `queryPathInfoUncached` computing `PathInfo`
* that we don't need just to return a `bool`.
*/
bool isValidPathUncached(const StorePath & path) override
{
return path.isDerivation() ? derivations.contains(path) : Store::isValidPathUncached(path);
}
/**
* The dummy store is incapable of *not* trusting! :)
*/