mirror of
https://github.com/hanzo-ds/native.git
synced 2026-10-30 20:00:34 +00:00
Module path, package names, and identifiers de-branded to native/proto/compress/ pool/tracing. Server wire-protocol strings preserved. Vendored codec surface used by hanzo-ds/go (proto + compress).
26 lines
417 B
Go
26 lines
417 B
Go
//go:build go1.23
|
|
|
|
package proto
|
|
|
|
import "iter"
|
|
|
|
// RowRange returns a [iter.Seq2] iterator over i-th row.
|
|
func (c ColMap[K, V]) RowRange(i int) iter.Seq2[K, V] {
|
|
var start int
|
|
end := int(c.Offsets[i])
|
|
if i > 0 {
|
|
start = int(c.Offsets[i-1])
|
|
}
|
|
|
|
return func(yield func(K, V) bool) {
|
|
for idx := start; idx < end; idx++ {
|
|
if !yield(
|
|
c.Keys.Row(idx),
|
|
c.Values.Row(idx),
|
|
) {
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|