Skip to content

Commit 18941a2

Browse files
committed
Optimize DummyStore::isValidPathUncached
See the API docs for the rationale of why this is needed.
1 parent 136825b commit 18941a2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/libstore/dummy-store.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ struct DummyStoreImpl : DummyStore
164164
callback(nullptr);
165165
}
166166

167+
/**
168+
* Do this to avoid `queryPathInfoUncached` computing `PathInfo`
169+
* that we don't need just to return a `bool`.
170+
*/
171+
bool isValidPathUncached(const StorePath & path) override
172+
{
173+
return path.isDerivation() ? derivations.contains(path) : Store::isValidPathUncached(path);
174+
}
175+
167176
/**
168177
* The dummy store is incapable of *not* trusting! :)
169178
*/

0 commit comments

Comments
 (0)