ExactLen would calculate the total number of UIDs. Instead of using a UidPack, it accepts blocks, so we can calculate the number of uids after a seek.
(pack *UidPack)
| 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. |
| 392 | func ExactLen(pack *UidPack) int { |
| 393 | if pack == nil { |
| 394 | return 0 |
| 395 | } |
| 396 | sz := len(pack.Blocks) |
| 397 | if sz == 0 { |
| 398 | return 0 |
| 399 | } |
| 400 | num := 0 |
| 401 | for _, b := range pack.Blocks { |
| 402 | num += int(b.NumUids) // NumUids includes the base UID. |
| 403 | } |
| 404 | return num |
| 405 | } |
| 406 | |
| 407 | // Decode decodes the UidPack back into the list of uids. This is a stop-gap function, Decode would |
| 408 | // need to do more specific things than just return the list back. |
nothing calls this directly
no outgoing calls
no test coverage detected