MakeKey creates a new interval key defined by start and end values.
(start, end []byte)
| 580 | |
| 581 | // MakeKey creates a new interval key defined by start and end values. |
| 582 | func (ic *IntervalCache) MakeKey(start, end []byte) IntervalKey { |
| 583 | if bytes.Compare(start, end) >= 0 { |
| 584 | panic(fmt.Sprintf("start key greater than or equal to end key %q >= %q", start, end)) |
| 585 | } |
| 586 | return IntervalKey{ |
| 587 | Range: interval.Range{ |
| 588 | Start: interval.Comparable(start), |
| 589 | End: interval.Comparable(end), |
| 590 | }, |
| 591 | id: uintptr(atomic.AddInt64(&intervalAlloc, 1)), |
| 592 | } |
| 593 | } |
| 594 | |
| 595 | // Implementation of cacheStore interface. |
| 596 | func (ic *IntervalCache) init() { |
no test coverage detected