mirror of
https://github.com/chaisql/chai.git
synced 2025-10-19 22:14:38 +08:00
stream: clone stream before execution
This commit is contained in:
@@ -17,6 +17,18 @@ func Concat(s ...*Stream) *ConcatOperator {
|
||||
return &ConcatOperator{Streams: s}
|
||||
}
|
||||
|
||||
func (it *ConcatOperator) Clone() Operator {
|
||||
streams := make([]*Stream, len(it.Streams))
|
||||
for i, s := range it.Streams {
|
||||
streams[i] = s.Clone()
|
||||
}
|
||||
|
||||
return &ConcatOperator{
|
||||
BaseOperator: it.BaseOperator.Clone(),
|
||||
Streams: streams,
|
||||
}
|
||||
}
|
||||
|
||||
func (it *ConcatOperator) Iterate(in *environment.Environment, fn func(*environment.Environment) error) error {
|
||||
for _, s := range it.Streams {
|
||||
if err := s.Iterate(in, fn); err != nil {
|
||||
|
Reference in New Issue
Block a user