forked from lix-project/lix
Cleanup
This commit is contained in:
parent
86a4aba6c4
commit
38ccf2e241
|
@ -42,15 +42,12 @@ std::map<string, StorePath> readOutputPathMap(const Store & store, Source & from
|
||||||
{
|
{
|
||||||
std::map<string, StorePath> pathMap;
|
std::map<string, StorePath> pathMap;
|
||||||
auto rawInput = readStrings<Strings>(from);
|
auto rawInput = readStrings<Strings>(from);
|
||||||
|
if (rawInput.size() % 2)
|
||||||
|
throw Error("got an odd number of elements from the daemon when trying to read a output path map");
|
||||||
auto curInput = rawInput.begin();
|
auto curInput = rawInput.begin();
|
||||||
while (curInput != rawInput.end()) {
|
while (curInput != rawInput.end()) {
|
||||||
string thisKey = *curInput;
|
auto thisKey = *curInput++;
|
||||||
curInput = std::next(curInput);
|
auto thisValue = *curInput++;
|
||||||
if (curInput == rawInput.end()) {
|
|
||||||
throw Error("Got an odd number of elements from the daemon when trying to read a map… that's odd");
|
|
||||||
}
|
|
||||||
string thisValue = *curInput;
|
|
||||||
curInput = std::next(curInput);
|
|
||||||
pathMap.emplace(thisKey, store.parseStorePath(thisValue));
|
pathMap.emplace(thisKey, store.parseStorePath(thisValue));
|
||||||
}
|
}
|
||||||
return pathMap;
|
return pathMap;
|
||||||
|
|
Loading…
Reference in a new issue