diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-07-01 15:31:34 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-07-01 15:31:34 +0200 |
commit | 38ccf2e24168ab5c0d2a7cf6b5bdec1b0784ebcd (patch) | |
tree | 20f85a97db886bfe40e53bd72d702039636ab6b1 /src/libstore/remote-store.cc | |
parent | 86a4aba6c4cf6713aed679019446070f23bb7d78 (diff) |
Cleanup
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r-- | src/libstore/remote-store.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index dc82dbdd9..8c648d671 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -42,15 +42,12 @@ std::map<string, StorePath> readOutputPathMap(const Store & store, Source & from { std::map<string, StorePath> pathMap; 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(); while (curInput != rawInput.end()) { - string thisKey = *curInput; - curInput = std::next(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); + auto thisKey = *curInput++; + auto thisValue = *curInput++; pathMap.emplace(thisKey, store.parseStorePath(thisValue)); } return pathMap; |