ApproxLen would indicate the total number of UIDs in the pack. Can be used for int slice allocations.
(pack *UidPack)
| 381 | // ApproxLen would indicate the total number of UIDs in the pack. Can be used for int slice |
| 382 | // allocations. |
| 383 | func ApproxLen(pack *UidPack) int { |
| 384 | if pack == nil { |
| 385 | return 0 |
| 386 | } |
| 387 | return len(pack.Blocks) * int(pack.BlockSize) |
| 388 | } |
| 389 | |
| 390 | // ExactLen would calculate the total number of UIDs. Instead of using a UidPack, it accepts blocks, |
| 391 | // so we can calculate the number of uids after a seek. |