| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
Similar reason for the API change as the previous commit.
|
|
|
|
|
| |
The implementation behind the API is not more efficient than manually
looping over a data structure and inserting elements one-by-one.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This commit adds an efficient builder for creating SortedMap objects.
|
|
|
|
|
| |
This commit provides a `MapBuilder` for efficiently combining multiple
`Map` mutations.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|