populateOffsets sets the Offset field on each block
(blocks []protocol.BlockInfo)
| 1242 | |
| 1243 | // populateOffsets sets the Offset field on each block |
| 1244 | func 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. |