diff --git a/collections/triple.go b/collections/triple.go index b465b25b877d..9733d9984099 100644 --- a/collections/triple.go +++ b/collections/triple.go @@ -273,26 +273,19 @@ func (t tripleKeyCodec[K1, K2, K3]) SizeNonTerminal(key Triple[K1, K2, K3]) int return size } -func PrefixTripleRange[K1, K2, K3 any](k1 K1) Ranger[Triple[K1, K2, K3]] { +// NewPrefixUntilTripleRange defines a collection query which ranges until the provided Pair prefix. +// Unstable: this API might change in the future. +func NewPrefixUntilTripleRange[K1, K2, K3 any](k1 K1) Ranger[Triple[K1, K2, K3]] { key := TriplePrefix[K1, K2, K3](k1) return &Range[Triple[K1, K2, K3]]{ - start: RangeKeyExact(key), - end: RangeKeyPrefixEnd(key), - } -} - -func SuperPrefixTripleRange[K1, K2, K3 any](k1 K1, k2 K2) Ranger[Triple[K1, K2, K3]] { - key := TripleSuperPrefix[K1, K2, K3](k1, k2) - return &Range[Triple[K1, K2, K3]]{ - start: RangeKeyExact(key), - end: RangeKeyPrefixEnd(key), + end: RangeKeyPrefixEnd(key), } } // NewPrefixedTripleRange provides a Range for all keys prefixed with the given // first part of the Triple key. -func NewPrefixedTripleRange[K1, K2, K3 any](prefix K1) Ranger[Triple[K1, K2, K3]] { - key := TriplePrefix[K1, K2, K3](prefix) +func NewPrefixedTripleRange[K1, K2, K3 any](k1 K1) Ranger[Triple[K1, K2, K3]] { + key := TriplePrefix[K1, K2, K3](k1) return &Range[Triple[K1, K2, K3]]{ start: RangeKeyExact(key), end: RangeKeyPrefixEnd(key),