]> Cypherpunks repositories - gostls13.git/commit
container/list: unexpected panic if Next/Prev called outside of list.
authorRichard Eric Gavaletz <gavaletz@gmail.com>
Mon, 9 Sep 2013 22:41:36 +0000 (15:41 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 9 Sep 2013 22:41:36 +0000 (15:41 -0700)
commit7adb42eee479382018621eb24c665cf83f3a73f7
tree8bb2a3beedd96641559d1d38c012c3bbec359d09
parent5dc8c4dbfb6a04d9eb7a11c9c3fe698d33d0c0ee
container/list: unexpected panic if Next/Prev called outside of list.

Before CL 7065067 calling Next on an element returned either the
next/prev element or nil was returned.  After the CL if an element
was not part of a list e.Next() and e.Prev() will panic.  This CL
returns to the documented behavior, that Next/Prev returns the
next/prev list element or nil.

Fixes #6349.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/13234051
src/pkg/container/list/list.go
src/pkg/container/list/list_test.go