MCPcopy Index your code
hub / github.com/syncthing/syncthing / Update

Method Update

lib/protocol/vector.go:122–125  ·  view source on GitHub ↗

Update returns a Vector with the index for the specific ID incremented by one. If it is possible, the vector v is updated and returned. If it is not, a copy will be created, updated and returned.

(id ShortID)

Source from the content-addressed store, hash-verified

120// one. If it is possible, the vector v is updated and returned. If it is not,
121// a copy will be created, updated and returned.
122func (v Vector) Update(id ShortID) Vector {
123 now := uint64(time.Now().Unix())
124 return v.updateWithNow(id, now)
125}
126
127func (v Vector) updateWithNow(id ShortID, now uint64) Vector {
128 for i := range v.Counters {

Callers 4

addFileMethod · 0.95
TestNeedFunction · 0.95
TestNeedPaginationFunction · 0.95

Calls 2

updateWithNowMethod · 0.95
NowMethod · 0.65

Tested by 4

addFileMethod · 0.76
TestNeedFunction · 0.76
TestNeedPaginationFunction · 0.76