aboutsummaryrefslogtreecommitdiff
path: root/immutable_test.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add Makefile and move files to structured foldersEuAndreh2024-12-141-2544/+0
|
* Fix random seed for TestRandomOskar Haarklou Veileborg2023-01-121-0/+1
| | | | | | The closure passed to t.Run captured the loop variable which would always be equal to `*randomN` once the tests started running. This meant that all of the runs used the same random seed.
* list: fix Append & Prepend, remove varargs supportOskar Haarklou Veileborg2023-01-121-0/+13
| | | | Similar reason for the API change as the previous commit.
* Fix SortedSet.Set. NewMapOf. docsAm Laher2022-12-281-2/+30
|
* Allow lists to contain non-comparable elementsOskar Haarklou Veileborg2022-11-171-0/+41
| | | | | | | | | | | | | | | | | The current design uses comparability of elements only to detect vacant entries in leaf node children lists, using the zero value of the element type as "vacant". The reason we care about vacant entries is to avoid copy operations in certain Slice calls. If the entries are not vacant, we have to "zero" the entries in the returned slice to remove references to allocated memory. Therefore, (hackily) treating the zero value as vacant works because the zero value for pointers is nil (it does not reference anything). However, requiring the list elements to be comparable is inconvenient. There shouldn't be a type bound on the elements of a general purpose list. With this change vacancy is kept track of with a bitset in list leaf nodes.
* add missing ptr types; tidyupAm Laher2022-06-111-61/+11
|
* update readmeAmir Laher2022-05-191-3/+3
|
* implement generic immutable mapsAmir Laher2022-05-191-218/+224
|
* convert lists to use genericsAmir Laher2022-05-191-38/+38
|
* Refactor buildersBen Johnson2020-11-171-53/+36
| | | | | | | This commit fixes a bug in builders that caused changes to leak when building on existing collections. The builders now only work on empty list & map types and are marked as invalid after the underlying collection has been retrieved from them.
* Add additional hashers & comparers.Adrian2020-09-221-4/+94
| | | | | | | | This commit adds all int & uint type hashers & comparers. It also provides reflection-based hashers & comparers for int, uint, & string types that are wrapped with a different named type. Co-authored-by: Ben Johnson <benbjohnson@yahoo.com>
* Add ListBuilder.Len()Ben Johnson2019-03-061-1/+3
| | | | | | This commit adds a method to check the current length of a list on a `ListBuilder`. This allows the length to be checked without marking the next builder change as immutable.
* Add SortedMapBuilderBen Johnson2019-03-061-28/+117
| | | | This commit adds an efficient builder for creating SortedMap objects.
* Remove go-cmp dependencyBen Johnson2019-03-061-4/+7
|
* Add MapBuilderBen Johnson2019-03-061-71/+226
| | | | | This commit provides a `MapBuilder` for efficiently combining multiple `Map` mutations.
* Add ListBuilder.Ben Johnson2019-03-041-13/+139
| | | | | | | | This commit adds a builder for more efficiently creating `List` objects. It works by mutating the list in-place until the current list is requested. After that request, the next mutation will occur on a copy but then continue to mutate in place. This allows lists to be returned and used while continuing to use the builder.
* Fix test coverage.Ben Johnson2019-03-021-0/+26
|
* Update random test settings.Ben Johnson2019-03-011-6/+2
|
* Minor iterator refactor; update commentBen Johnson2019-03-011-9/+6
|
* (no commit message)Ben Johnson2019-03-011-0/+2038