MCPcopy
hub / github.com/syncthing/syncthing / populateOffsets

Function populateOffsets

lib/model/folder_sendrecv.go:1244–1250  ·  view source on GitHub ↗

populateOffsets sets the Offset field on each block

(blocks []protocol.BlockInfo)

Source from the content-addressed store, hash-verified

1242
1243// populateOffsets sets the Offset field on each block
1244func populateOffsets(blocks []protocol.BlockInfo) {
1245 var offset int64
1246 for i := range blocks {
1247 blocks[i].Offset = offset
1248 offset += int64(blocks[i].Size)
1249 }
1250}
1251
1252// shortcutFile sets file metadata, when that's the only thing that has
1253// changed.

Callers 1

handleFileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected