about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2016-10-07T17·46+0200
committerEelco Dolstra <edolstra@gmail.com>2016-10-07T17·46+0200
commit0c85ef7090898a9152c2a6fd31633aa7fc8550b3 (patch)
treed487a638924fcc9a4d9c73cd4cf5e97b2a9bd70d /src/libstore
parent844219f36450e94268da3f60e93efdf67055355c (diff)
LocalStore::querySubstitutablePaths(): Implement using queryValidPaths()
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/local-store.cc10
1 files changed, 3 insertions, 7 deletions
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;
 }