(id common.ID)
| 31 | } |
| 32 | |
| 33 | func (i *index) Find(id common.ID) int { |
| 34 | n := sort.Search(len(i.RowGroups), func(j int) bool { |
| 35 | return bytes.Compare(id, i.RowGroups[j]) <= 0 |
| 36 | }) |
| 37 | if n >= len(i.RowGroups) { |
| 38 | // Beyond the last row group. This is the only |
| 39 | // area where presence can be ruled out. |
| 40 | return -1 |
| 41 | } |
| 42 | return n |
| 43 | } |
| 44 | |
| 45 | func unmarshalIndex(b []byte) (*index, error) { |
| 46 | i := &index{} |