lib/db: Various polish (#5471)

naming: buf -> keyBuf
dedup: use getFileTrunc
manually inline insertFile
This commit is contained in:
Simon Frei
2019-01-20 10:24:39 +01:00
committed by Jakob Borg
parent 29e4b417f2
commit a371b15398
4 changed files with 15 additions and 27 deletions

View File

@@ -272,12 +272,12 @@ func (m *metadataTracker) Counts(dev protocol.DeviceID, flag uint32) Counts {
return m.counts.Counts[idx]
}
// nextSeq allocates a new sequence number for the given device
func (m *metadataTracker) nextSeq(dev protocol.DeviceID) int64 {
// nextLocalSeq allocates a new local sequence number
func (m *metadataTracker) nextLocalSeq() int64 {
m.mut.Lock()
defer m.mut.Unlock()
c := m.countsPtr(dev, 0)
c := m.countsPtr(protocol.LocalDeviceID, 0)
c.Sequence++
return c.Sequence
}