GetBytes retrieves the raw data of value in []byte at "idx" and return it. Performance note Involves 2 memory access: a.Bitmaps a.Elts Involves 0 alloc Since 0.2.0
(idx int32, eltsize int)
| 159 | // |
| 160 | // Since 0.2.0 |
| 161 | func (a *Base) GetBytes(idx int32, eltsize int) ([]byte, bool) { |
| 162 | r, b := bitmap.Rank64(a.Bitmaps, a.Offsets, idx) |
| 163 | if b == 0 { |
| 164 | return nil, false |
| 165 | } |
| 166 | |
| 167 | stIdx := int32(eltsize) * r |
| 168 | return a.Elts[stIdx : stIdx+int32(eltsize)], true |
| 169 | } |
no outgoing calls