e.next = nil // avoid memory leaks e.prev = nil // avoid memory leaks

/Go/src/container/list/list.go:10

// remove removes e from its list, decrements l.len, and returns e.
func (l *List) remove(e *Element) *Element {
e.prev.next = e.next
e.next.prev = e.prev
e.next = nil // avoid memory leaks
e.prev = nil // avoid memory leaks
e.list = nil
l.len--
return e
}
上一篇:Min Stack (LeetCode) tweak it to avoid Memory Limit Exceeded


下一篇:Gitlab+Jenkins实现自动部署