We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1c8d2f commit ec58dfeCopy full SHA for ec58dfe
pkg/planner/memo/task.go
@@ -47,7 +47,7 @@ func newTaskStack() *TaskStack {
47
// Destroy indicates that when stack itself is useless like in the end of optimizing phase, we can destroy ourselves.
48
func (ts *TaskStack) Destroy() {
49
// when a taskStack itself is useless, we can destroy itself actively.
50
- ts.tasks = ts.tasks[:0]
+ clear(ts.tasks)
51
TaskStackPool.Put(ts)
52
}
53
pkg/planner/memo/task_test.go
@@ -89,4 +89,7 @@ func TestTaskFunctionality(t *testing.T) {
89
90
// self destroy.
91
taskStack.Destroy()
92
+ taskTaskPool = TaskStackPool.Get()
93
+ require.Equal(t, len(taskTaskPool.(*TaskStack).tasks), 0)
94
+ require.Equal(t, cap(taskTaskPool.(*TaskStack).tasks), 4)
95
0 commit comments