]> Cypherpunks repositories - gostls13.git/commit
container/list: fix Remove bug and use pointer to self as identifier
authorAndrew Gerrand <adg@golang.org>
Mon, 25 Oct 2010 03:37:30 +0000 (14:37 +1100)
committerAndrew Gerrand <adg@golang.org>
Mon, 25 Oct 2010 03:37:30 +0000 (14:37 +1100)
commit01389b966ed81fad6e5fac3e98fe46e162645659
tree0aa0fcb989a06021afb35586f4b292253ee61459
parentee065332dda70b12be42a52b12c1867529d62cec
container/list: fix Remove bug and use pointer to self as identifier

Remove wasn't nil'ing the *Element.id. This property was exploited
by MoveToFront and MoveToBack internally, so I renamed the existing
Remove to "remove", and created an exported wrapper "Remove" that does
the right thing for the user's sake.

Also, saved an allocation by using *List as the id rather than *byte.

Fixes #1224.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/2685042
src/pkg/container/list/list.go
src/pkg/container/list/list_test.go