aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-04 22:28:10 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-04 22:28:10 +0000
commit1dfcbebc95f1c74763770bb2bd7afdebe8804845 (patch)
tree6947499809e358373851911302b50e05018a1159 /src/libstore
parent45b6fdb22b05352108b6470ae16d611431c06666 (diff)
Organize and format code a bit
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/remote-store.cc17
-rw-r--r--src/libstore/store-api.cc16
2 files changed, 17 insertions, 16 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index dc2efefeb..772979066 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -31,7 +31,6 @@ template<> StorePathSet readStorePaths(const Store & store, Source & from)
return paths;
}
-
void writeStorePaths(const Store & store, Sink & out, const StorePathSet & paths)
{
out << paths.size();
@@ -39,11 +38,6 @@ void writeStorePaths(const Store & store, Sink & out, const StorePathSet & paths
out << store.printStorePath(i);
}
-StorePath read(const Store & store, Source & from, Proxy<StorePath> _)
-{
- auto path = readString(from);
- return store.parseStorePath(path);
-}
StorePathCAMap readStorePathCAMap(const Store & store, Source & from)
{
@@ -63,10 +57,17 @@ void writeStorePathCAMap(const Store & store, Sink & out, const StorePathCAMap &
}
}
+
+StorePath read(const Store & store, Source & from, Proxy<StorePath> _)
+{
+ auto path = readString(from);
+ return store.parseStorePath(path);
+}
+
void write(const Store & store, Sink & out, const StorePath & storePath)
{
- auto path = store.printStorePath(storePath);
- out << path;
+ auto path = store.printStorePath(storePath);
+ out << path;
}
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 4c68709ef..e894d2b85 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -362,14 +362,14 @@ bool Store::PathInfoCacheValue::isKnownNow()
}
OutputPathMap Store::queryDerivationOutputMapAssumeTotal(const StorePath & path) {
- auto resp = queryDerivationOutputMap(path);
- OutputPathMap result;
- for (auto & [outName, optOutPath] : resp) {
- if (!optOutPath)
- throw Error("output '%s' has no store path mapped to it", outName);
- result.insert_or_assign(outName, *optOutPath);
- }
- return result;
+ auto resp = queryDerivationOutputMap(path);
+ OutputPathMap result;
+ for (auto & [outName, optOutPath] : resp) {
+ if (!optOutPath)
+ throw Error("output '%s' has no store path mapped to it", outName);
+ result.insert_or_assign(outName, *optOutPath);
+ }
+ return result;
}
StorePathSet Store::queryDerivationOutputs(const StorePath & path)