(segIdx int)
| 36 | } |
| 37 | |
| 38 | func (it *Iterator) nextForSegment(segIdx int) *Entry { |
| 39 | it.cache.locks[segIdx].Lock() |
| 40 | defer it.cache.locks[segIdx].Unlock() |
| 41 | seg := &it.cache.segments[segIdx] |
| 42 | for it.slotIdx < 256 { |
| 43 | entry := it.nextForSlot(seg, it.slotIdx) |
| 44 | if entry != nil { |
| 45 | return entry |
| 46 | } |
| 47 | it.slotIdx++ |
| 48 | it.entryIdx = 0 |
| 49 | } |
| 50 | return nil |
| 51 | } |
| 52 | |
| 53 | func (it *Iterator) nextForSlot(seg *segment, slotId int) *Entry { |
| 54 | slotOff := int32(it.slotIdx) * seg.slotCap |