MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / MakeKey

Method MakeKey

pkg/util/cache/cache.go:582–593  ·  view source on GitHub ↗

MakeKey creates a new interval key defined by start and end values.

(start, end []byte)

Source from the content-addressed store, hash-verified

580
581// MakeKey creates a new interval key defined by start and end values.
582func (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.
596func (ic *IntervalCache) init() {

Callers 1

NewKeyMethod · 0.95

Calls 2

ComparableTypeAlias · 0.92
CompareMethod · 0.65

Tested by

no test coverage detected