style(3p/nix): Add braces around single-line conditionals

These were not caught by the previous clang-tidy invocation, but were
instead sorted out using amber[0] as such:

    ambr --regex 'if (\(.+\))\s([a-z].*;)' 'if $1 { $2 }'

[0]: https://github.com/dalance/amber
This commit is contained in:
Vincent Ambo 2020-05-19 18:55:58 +01:00
parent c6a31838cd
commit 867055133d
97 changed files with 2223 additions and 753 deletions

View file

@ -143,7 +143,9 @@ class NarInfoDiskCacheImpl : public NarInfoDiskCache {
Cache& getCache(State& state, const std::string& uri) {
auto i = state.caches.find(uri);
if (i == state.caches.end()) abort();
if (i == state.caches.end()) {
abort();
}
return i->second;
}
@ -170,7 +172,9 @@ class NarInfoDiskCacheImpl : public NarInfoDiskCache {
auto i = state->caches.find(uri);
if (i == state->caches.end()) {
auto queryCache(state->queryCache.use()(uri));
if (!queryCache.next()) return false;
if (!queryCache.next()) {
return false;
}
state->caches.emplace(
uri, Cache{(int)queryCache.getInt(0), queryCache.getStr(1),
queryCache.getInt(2) != 0, (int)queryCache.getInt(3)});
@ -199,9 +203,13 @@ class NarInfoDiskCacheImpl : public NarInfoDiskCache {
now - settings.ttlNegativeNarInfoCache)(
now - settings.ttlPositiveNarInfoCache));
if (!queryNAR.next()) return {oUnknown, 0};
if (!queryNAR.next()) {
return {oUnknown, 0};
}
if (!queryNAR.getInt(0)) return {oInvalid, 0};
if (!queryNAR.getInt(0)) {
return {oInvalid, 0};
}
auto narInfo = make_ref<NarInfo>();
@ -210,7 +218,9 @@ class NarInfoDiskCacheImpl : public NarInfoDiskCache {
(namePart.empty() ? "" : "-" + namePart);
narInfo->url = queryNAR.getStr(2);
narInfo->compression = queryNAR.getStr(3);
if (!queryNAR.isNull(4)) narInfo->fileHash = Hash(queryNAR.getStr(4));
if (!queryNAR.isNull(4)) {
narInfo->fileHash = Hash(queryNAR.getStr(4));
}
narInfo->fileSize = queryNAR.getInt(5);
narInfo->narHash = Hash(queryNAR.getStr(6));
narInfo->narSize = queryNAR.getInt(7);