Having the test be in the container/heap package yields a cycle
container/heap (for the test)
-> testing
-> time
-> container/heap (for timerHeap)
Occasionally the linker would get mixed up, resulting in a test panic
in a very weird place.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/4395042
Faster in most cases, and not prone to memory leaks. Named "Do" to match with similarly named method on Vector.
R=gri
CC=golang-dev
https://golang.org/cl/4134046
I have written a tool to verify Printf calls, and although it's not
ready to be reviewed yet it's already uncovered a spate of problems
in the repository. I'm sending this CL to break the changes into
pieces; as the tool improves it will find more, I'm sure.
R=rsc
CC=golang-dev
https://golang.org/cl/3427043
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
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
Package iterable has outlived its utility.
It is an interesting demonstration, but it encourages
people to use iteration over channels where simple
iteration over array indices or a linked list would be
cheaper, simpler, and have fewer races.
R=dsymonds, r
CC=golang-dev
https://golang.org/cl/2436041
Also, move Do() to vector.go, so that Do() for IntVector and StringVector
is autogenerated.
The only files edited are Makefile, defs.go, and vector.go. The rest are
autogenerated with "make generate".
R=r
CC=golang-dev, hoisie
https://golang.org/cl/1435041
as it is not needed anymore (only one impl.
of vector package).
Makefile, vector_test.go, and nogen_test.go
were modified manually (find/replace), the
other files (intvector_test.go, strinvector_test.go
are generated).
Runs all tests.
R=r
https://golang.org/cl/182041
Manual changes to the following files:
src/pkg/Makefile
src/pkg/exp/vector/Makefile (now: src/pkg/container/vector/Makefile)
R=rsc, r
CC=golang-dev
https://golang.org/cl/181041
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
1st set of files.
R=rsc
CC=agl, golang-dev, iant, ken2, r
https://golang.org/cl/180047
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.
this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.
Fixes#115.
R=rsc, dsymonds1
https://golang.org/cl/157067
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)
R=r, rsc
CC=go-dev
http://go/go-review/1026006
container/list:
- change Iter to go over the list values
container/ring:
- add Iter, drop Forward/Backward
container/vector:
- add channel direction constraints
R=rsc,gri
APPROVED=rsc
DELTA=86 (23 added, 40 deleted, 23 changed)
OCL=33935
CL=34132