aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/container
AgeCommit message (Collapse)Author
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
2014-05-15container/heap: update example codeRobert Griesemer
- use Init to establish heap invariant on a non-empty heap - use Fix to update heap after an element's properties have been changed (The old code used Init where it wasn't needed, and didn't use Fix because Fix was added after the example was written.) LGTM=bradfitz R=adonovan, bradfitz CC=golang-codereviews https://golang.org/cl/94520043
2014-05-02std lib: fix various typos in commentsRobert Griesemer
Where the spelling changed from British to US norm (e.g., optimise -> optimize) it follows the style in that file. LGTM=adonovan R=golang-codereviews, adonovan CC=golang-codereviews https://golang.org/cl/96980043
2014-04-16all: fix typosRui Ueyama
LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/88670043
2014-02-13container/list: mark must be an element of the listMarkus Zimmermann
The methods MoveAfter and MoveBefore of the container/list package did silently corrupt the interal structure of the list if a mark element is used which is not an element of the list. LGTM=gri R=golang-codereviews, gobot, gri CC=golang-codereviews https://golang.org/cl/60980043
2014-02-10container/heap: avoid and/or ambiguity in documentationRobert Griesemer
(per suggestion by Doug McIlroy) LGTM=r R=r CC=golang-codereviews https://golang.org/cl/50580046
2014-01-05container/list: improve test coverageShawn Smith
R=golang-codereviews, dave, gobot, bradfitz, gri CC=golang-codereviews https://golang.org/cl/46640043
2013-12-31container/ring: add test for Move with empty RingShawn Smith
R=golang-codereviews, dave CC=golang-codereviews https://golang.org/cl/46630044
2013-12-17container/list: Add missing period to doc comment for FrontCaleb Spare
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/38540046
2013-09-09container/list: unexpected panic if Next/Prev called outside of list.Richard Eric Gavaletz
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
2013-08-08container/list: fix typo in commentRob Pike
Fixes #6058. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12643043
2013-08-05container/heap: add Fix and document the min is element 0.Pieter Droogendijk
Fixes #5372. Fixes #5577. R=gri, rsc, bradfitz, r CC=golang-dev https://golang.org/cl/12265043
2013-07-31container/list: added MoveBefore and MoveAfterPieter Droogendijk
Fixes #4940. R=golang-dev, bradfitz, gri CC=golang-dev https://golang.org/cl/12021044
2013-07-30container/list: document complexity of LenRobert Griesemer
Fixes #5972. R=golang-dev, adonovan CC=golang-dev https://golang.org/cl/12125043
2013-03-04container/heap: fix int overflow bugStefan Nilsson
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7450052
2013-02-19src: use internal tests if possibleRobin Eklind
If a test can be placed in the same package ("internal"), it is placed there. This facilitates testing of package-private details. Because of dependency cycles some packages cannot be tested by internal tests. R=golang-dev, rsc, mikioh.mikioh CC=golang-dev, r https://golang.org/cl/7323044
2013-02-11container/list: add package exampleAndrew Gerrand
R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/7306078
2013-02-05container/heap: fix comment typo in example testCaleb Spare
This updates a bad reference to a method name in the example priority queue test. The error was introduced in the example refactoring in rev. 2ea8f07b2ffe. R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/7279045
2013-02-04container/heap: fix package doc comment about ordering.Nigel Tao
R=gri, rsc CC=golang-dev https://golang.org/cl/7280044
2013-01-30container/heap: split example into twoCaleb Spare
This adds a simple IntHeap example, and modifies the more complex PriorityQueue example to make use of the index field it maintains. Fixes #4331. R=rsc, adg CC=golang-dev https://golang.org/cl/7068048
2013-01-09container/list: avoid memory leaksRobert Griesemer
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/7065067
2012-12-04container/heap: Simplify the example.Frithjof Schulze
Using append simplifies the code and makes it work if the initial capacity of the slice is smaller than the number of items pushed. R=golang-dev, gri CC=golang-dev https://golang.org/cl/6869060
2012-11-22all: fix the the typosShenghou Ma
Fixes #4420. R=golang-dev, rsc, remyoudompheng CC=golang-dev https://golang.org/cl/6854080
2012-10-28container/list: fix typoTaj Khattra
R=golang-dev, fullung, dave, minux.ma CC=golang-dev https://golang.org/cl/6682046
2012-10-10container/heap: optimization in case heap has many duplicatesTaj Khattra
benchmark old ns/op new ns/op delta BenchmarkDup 3075682 609448 -80.18% R=gri CC=golang-dev https://golang.org/cl/6613064
2012-09-28container/list: slightly better code factoringRobert Griesemer
R=golang-dev, adg CC=golang-dev https://golang.org/cl/6569077
2012-09-28container/list: Correctly maintain internal invariantsRobert Griesemer
The previous implementation was a mess with invariants maintained inconsistently. Essentially reimplemented the package: - used a circular list as internal representation for significantly simpler implementation with fewer special cases while maintaining the illusion of a nil-terminated doubly linked list externally - more precise documentation - cleaned up and simplified tests, added test case for issue 4103. No changes to the API or documented semantics. All this said, I would be in favor of removing this package eventually. container/ring provides a faster implementation and a simpler and more powerful API. Fixes #4103. R=r CC=golang-dev https://golang.org/cl/6569072
2012-02-16godoc: make example code more readable with new comment conventionAndrew Gerrand
go/doc: move Examples to go/ast cmd/go: use go/doc to read examples src/pkg: update examples to use new convention This is to make whole file examples more readable. When presented as a complete function, preceding an Example with its output is confusing. The new convention is to put the expected output in the final comment of the example, preceded by the string "output:" (case insensitive). An idiomatic example looks like this: // This example demonstrates Foo by doing bar and quux. func ExampleFoo() { // example body that does bar and quux // Output: // example output } R=rsc, gri CC=golang-dev https://golang.org/cl/5673053
2012-02-16godoc: support for package examples, display example suffixesAndrew Gerrand
Fixes #2896. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5677047
2012-02-10container/heap: add exampleRob Pike
godoc doesn't have the fu to present the example well, but this gives us an example of an example to develop example fu. Fixes #2840. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5645063
2012-01-30build: remove Make.pkg, Make.toolRuss Cox
Consequently, remove many package Makefiles, and shorten the few that remain. gomake becomes 'go tool make'. Turn off test phases of run.bash that do not work, flagged with $BROKEN. Future CLs will restore these, but this seemed like a big enough CL already. R=golang-dev, r CC=golang-dev https://golang.org/cl/5601057
2012-01-17container/heap: better package documentationRob Pike
Fixes #1820. R=golang-dev, bradfitz, gri CC=golang-dev https://golang.org/cl/5540073
2011-11-03container/heap: document what Push and Pop doRuss Cox
Now that vector is gone, there is no precedent to refer to. This is a confusing point for people looking to use the package. R=golang-dev, r, cw CC=golang-dev https://golang.org/cl/5322069
2011-11-02all: sort importsRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/5319072
2011-10-11container/vector: deleteRob Pike
Slices are better: http://code.google.com/p/go-wiki/wiki/SliceTricks R=golang-dev, bradfitz, dsymonds CC=golang-dev https://golang.org/cl/5248060
2011-08-22container/heap/heap_test.go: remove container/vectorRob Pike
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/4919044
2011-07-14go/printer: changed max. number of newlines from 3 to 2Robert Griesemer
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go (cd src/cmd/gofix/testdata; gofmt -w *.in *.out) (cd src/pkg/go/printer; gotest -update) gofmt -w misc src runs all tests R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4715041
2011-05-18pkg: spelling tweaks, A-HRobert Hencke
R=ality, bradfitz, rsc, dsymonds, adg, qyzhai, dchest CC=golang-dev https://golang.org/cl/4536063
2011-04-22container/heap: fix circular dependency in testDavid Symonds
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
2011-04-20src/pkg: make package doc comments consistently start with "Package foo".Nigel Tao
R=rsc CC=golang-dev https://golang.org/cl/4442064
2011-03-26testing: shorten some more testsRob Pike
R=rsc CC=golang-dev https://golang.org/cl/4314044
2011-02-08 container/ring: Replace Iter() with Do().Kyle Consalus
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
2011-01-19delete float, complex - code changesRuss Cox
also: cmplx -> complex float64(1.0) -> 1.0 float64(1) -> 1.0 R=gri, r, gri1, r2 CC=golang-dev https://golang.org/cl/3991043
2010-12-08throughout: simplify two-variable ranges with unused second variableRyan Hitchman
R=golang-dev, gri CC=golang-dev https://golang.org/cl/3529041
2010-12-07throughout: fix broken calls to Printf etc.Rob Pike
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
2010-11-09container/list: make Remove return Value of removed element.Roger Peppe
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
2010-10-29container/list: document iterationAndrew Gerrand
R=rsc CC=golang-dev https://golang.org/cl/2768042
2010-10-25container/list: elide redundant tests and fix comment typoAndrew Gerrand
R=dsymonds CC=golang-dev https://golang.org/cl/2700041
2010-10-25container/list: fix Remove bug and use pointer to self as identifierAndrew Gerrand
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
2010-10-11exp/iterable: deleteRuss Cox
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