func (list *SimplyList) RemoveList() { var node *Node for list.head != nil { node = list.head list.head = list.head.next cleaner.Clear(node) } list.tail = nil }
func (list *SimplyList) RemoveHead() { if list.head != nil { var node *Node = list.head list.head = list.head.next cleaner.Clear(node) if list.head == nil { list.tail = nil } } }
func (list *SimplyList) RemoveAfter(node *Node) { if node != nil { var temp *Node = node.next if temp != nil { if temp == list.tail { list.tail = node } node.next = temp.next cleaner.Clear(temp) } else { list.RemoveHead() } } }