ApproxLen would indicate the total number of UIDs in the pack. Can be used for int slice allocations.
(pack *pb.UidPack)
| 416 | // ApproxLen would indicate the total number of UIDs in the pack. Can be used for int slice |
| 417 | // allocations. |
| 418 | func ApproxLen(pack *pb.UidPack) int { |
| 419 | if pack == nil { |
| 420 | return 0 |
| 421 | } |
| 422 | return len(pack.Blocks) * int(pack.BlockSize) |
| 423 | } |
| 424 | |
| 425 | // ExactLen would calculate the total number of UIDs. Instead of using a UidPack, it accepts blocks, |
| 426 | // so we can calculate the number of uids after a seek. |
no outgoing calls