1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 11:36:03 +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 136825b4a2
commit 18941a2421

View file

@ -164,6 +164,15 @@ struct DummyStoreImpl : DummyStore
callback(nullptr); 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! :) * The dummy store is incapable of *not* trusting! :)
*/ */