summaryrefslogtreecommitdiffhomepage
path: root/pkg/ilist/interface_list.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-06 20:34:15 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-06 20:34:15 +0000
commitd80c5b0c6b44bb145788d699b8ffac109c5937d6 (patch)
tree7ff5ca6054a625835c606216a0a4578cfffc285c /pkg/ilist/interface_list.go
parent57eb9dd84e0153bb1848c0246d86ef23d116d9a2 (diff)
parent6fa5cee82c0f515b001dee5f3840e1f875b2f477 (diff)
Merge release-20200219.0-122-g6fa5cee (automated)
Diffstat (limited to 'pkg/ilist/interface_list.go')
-rwxr-xr-xpkg/ilist/interface_list.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/ilist/interface_list.go b/pkg/ilist/interface_list.go
index a69f736c6..aeb636f52 100755
--- a/pkg/ilist/interface_list.go
+++ b/pkg/ilist/interface_list.go
@@ -154,8 +154,9 @@ func (l *List) InsertBefore(a, e Element) {
// Remove removes e from l.
func (l *List) Remove(e Element) {
- prev := ElementMapper{}.linkerFor(e).Prev()
- next := ElementMapper{}.linkerFor(e).Next()
+ linker := ElementMapper{}.linkerFor(e)
+ prev := linker.Prev()
+ next := linker.Next()
if prev != nil {
ElementMapper{}.linkerFor(prev).SetNext(next)
@@ -168,6 +169,9 @@ func (l *List) Remove(e Element) {
} else {
l.tail = prev
}
+
+ linker.SetNext(nil)
+ linker.SetPrev(nil)
}
// Entry is a default implementation of Linker. Users can add anonymous fields