Commit b471d227 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a618da28
...@@ -339,8 +339,8 @@ func IntSets(N int) chan []int { ...@@ -339,8 +339,8 @@ func IntSets(N int) chan []int {
func intSets(ch chan []int, lo, hi int) { func intSets(ch chan []int, lo, hi int) {
ch <- []int{} // ø ch <- []int{} // ø
for i := lo; i < hi; i++ { if lo < hi {
if i < hi-1 { for i := lo; i < hi; i++ {
chTail := make(chan []int) chTail := make(chan []int)
go intSets(chTail, i+1, hi) go intSets(chTail, i+1, hi)
for tail := range chTail { for tail := range chTail {
...@@ -360,9 +360,8 @@ func TestIntSets(t *testing.T) { ...@@ -360,9 +360,8 @@ func TestIntSets(t *testing.T) {
I := func(v ...int) []int { return v } I := func(v ...int) []int { return v }
want := [][]int{I(), want := [][]int{I(),
I(0), I(0), I(0,1), I(0,1,2), I(0,2),
I(0,1), I(0,2), I(0,1,2), I(1), I(1,2),
I(1),
I(2), I(2),
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment