From 18a9077246d1916c5c5c413d7394cbeb5b6186d6 Mon Sep 17 00:00:00 2001 From: chrislusf Date: Fri, 4 Mar 2016 00:18:37 -0800 Subject: [PATCH] add buffer for slice channel --- flow/dataset_source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/dataset_source.go b/flow/dataset_source.go index a0dc0d4..76e23b8 100644 --- a/flow/dataset_source.go +++ b/flow/dataset_source.go @@ -94,7 +94,7 @@ func (fc *FlowContext) Slice(slice interface{}) (ret *Dataset) { sliceValue, sliceType := reflect.ValueOf(slice), reflect.TypeOf(slice) sliceLen := sliceValue.Len() chType := reflect.ChanOf(reflect.BothDir, sliceType.Elem()) - chValue := reflect.MakeChan(chType, 0) + chValue := reflect.MakeChan(chType, 16) go func() { for i := 0; i < sliceLen; i++ {