lib/db: Fix some omitted error checks, unused variable (#7489)

This commit is contained in:
Jakob Borg
2021-03-17 21:41:07 +01:00
committed by GitHub
parent f014b7b919
commit 6e5514419d
4 changed files with 11 additions and 3 deletions
+2 -3
View File
@@ -148,10 +148,9 @@ func (m *metadataTracker) countsPtr(dev protocol.DeviceID, flag uint32) *Counts
// the metadatatracker, even if there's no change to the need
// bucket itself.
nkey := metaKey{dev, needFlag}
nidx, ok := m.indexes[nkey]
if !ok {
if _, ok := m.indexes[nkey]; !ok {
// Initially a new device needs everything, except deletes
nidx = len(m.counts.Counts)
nidx := len(m.counts.Counts)
m.counts.Counts = append(m.counts.Counts, m.allNeededCounts(dev))
m.indexes[nkey] = nidx
}