MCPcopy Create free account
hub / github.com/dgraph-io/dgraph-benchmarks / ApproxLen

Function ApproxLen

bitmap/codec.go:383–388  ·  view source on GitHub ↗

ApproxLen would indicate the total number of UIDs in the pack. Can be used for int slice allocations.

(pack *UidPack)

Source from the content-addressed store, hash-verified

381// ApproxLen would indicate the total number of UIDs in the pack. Can be used for int slice
382// allocations.
383func 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.

Callers 1

DecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected