• Roger Peppe's avatar
    container/list: make Remove return Value of removed element. · e9afb9d3
    Roger Peppe authored
    When it is known that there is already at least one element in the
    list, it is awkwardly verbose to use three lines and an extra
    variable declaration to remove the first or last item (a common
    case), rather than use a simple expression.
    
    a stack:
    	stk.PushFront(x)
    	x = stk.Front().Remove().(T)
    
    vs.
    	stk.PushFront(x)
    	e := stk.Front()
    	e.Remove()
    	x = e.Value.(T)
    [An alternative CL might be to add PopFront and PopBack methods].
    
    R=gri
    CC=golang-dev
    https://golang.org/cl/3000041
    e9afb9d3
Name
Last commit
Last update
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...