From 0c85ef7090898a9152c2a6fd31633aa7fc8550b3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 7 Oct 2016 19:46:56 +0200 Subject: LocalStore::querySubstitutablePaths(): Implement using queryValidPaths() --- src/libstore/local-store.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/libstore/local-store.cc') diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 7cd84d03d4a8..41e1c37a0572 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -783,15 +783,11 @@ PathSet LocalStore::querySubstitutablePaths(const PathSet & paths) if (!settings.useSubstitutes) return PathSet(); PathSet res; for (auto & sub : getDefaultSubstituters()) { + if (res.size() == paths.size()) break; if (sub->storeDir != storeDir) continue; if (!sub->wantMassQuery()) continue; - for (auto & path : paths) { - if (res.count(path)) continue; - debug(format("checking substituter ā€˜%sā€™ for path ā€˜%sā€™") - % sub->getUri() % path); - if (sub->isValidPath(path)) - res.insert(path); - } + for (auto path : sub->queryValidPaths(paths)) + res.insert(path); } return res; } -- cgit 1.4.1