int-iterator is now defined interval

This commit is contained in:
2026-07-28 07:16:49 +02:00
parent 8e596d5979
commit 648533cbe3
12 changed files with 90 additions and 70 deletions
+11
View File
@@ -11,6 +11,7 @@ import (
"git.portale-stac.it/go-pkg/expr/kern"
"git.portale-stac.it/go-pkg/expr/types"
"git.portale-stac.it/go-pkg/expr/types/interval"
)
type IntIterator struct {
@@ -21,6 +22,16 @@ type IntIterator struct {
step int64
}
func NewIntIteratorFromInterval(p *interval.IntervalType) (it *IntIterator, err error) {
b := p.Begin()
e := p.End()
s := p.Step()
if b > e {
s = -s
}
return NewIntIteratorA(b, e, s)
}
func NewIntIteratorA(args ...any) (it *IntIterator, err error) {
return NewIntIterator(args)
}