fix(3p/nix): apply all clang-tidy fixes

Change-Id: I265e763393422ee1881653527c91024458060825
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1432
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Kane York 2020-07-24 21:09:44 -07:00 committed by kanepyork
parent 69f402563a
commit ef54f5da9f
65 changed files with 580 additions and 497 deletions

View file

@ -55,10 +55,10 @@ class NarInfoDiskCacheImpl final : public NarInfoDiskCache {
const int purgeInterval = 24 * 3600;
struct Cache {
int id;
int id{};
Path storeDir;
bool wantMassQuery;
int priority;
bool wantMassQuery{};
int priority{};
};
struct State {
@ -164,8 +164,9 @@ class NarInfoDiskCacheImpl final : public NarInfoDiskCache {
static_cast<int64_t>(wantMassQuery))(priority)
.exec();
assert(sqlite3_changes(state->db) == 1);
state->caches[uri] = Cache{(int)sqlite3_last_insert_rowid(state->db),
storeDir, wantMassQuery, priority};
state->caches[uri] =
Cache{static_cast<int>(sqlite3_last_insert_rowid(state->db)),
storeDir, wantMassQuery, priority};
});
}
@ -181,8 +182,9 @@ class NarInfoDiskCacheImpl final : public NarInfoDiskCache {
return false;
}
state->caches.emplace(
uri, Cache{(int)queryCache.getInt(0), queryCache.getStr(1),
queryCache.getInt(2) != 0, (int)queryCache.getInt(3)});
uri, Cache{static_cast<int>(queryCache.getInt(0)),
queryCache.getStr(1), queryCache.getInt(2) != 0,
static_cast<int>(queryCache.getInt(3))});
}
auto& cache(getCache(*state, uri));