Commit Graph
467 Commits
Author SHA1 Message Date
Karoy Lorentey d3987c79a1 Merge branch 'release/1.1'
# Conflicts:
#	Package.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+Extras.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra isEqual.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra isStrictSubset.swift
2022-10-19 18:25:48 -07:00
Saleem Abdulrasool 67fdff5a25 Update CMakeLists.txt
Remove missing file.  Thanks to @stevenbrix for identifying this!

(cherry picked from commit 5e0a0149a4)
2022-10-19 17:58:47 -07:00
Karoy Lorentey 56be3ae3fd [PersistentSet] Adjust code after merge 2022-10-19 17:58:47 -07:00
Karoy Lorentey 25fd503fac [PersistentCollections] Fix up code added since c73a8caa originally landed
(cherry picked from commit 4c842df1b8)
2022-10-19 17:58:47 -07:00
Karoy Lorentey bceadab267 [PersistentCollections] Reduce popcount usages where possible
# Conflicts:
#	Sources/PersistentCollections/Node/_Node+Primitive Removals.swift

(cherry picked from commit e153ebf798)
2022-10-19 17:58:46 -07:00
Karoy Lorentey 6b516b72fb [PersistentCollections] Slightly more readable index descriptions
(cherry picked from commit 785caa4a55)
2022-10-19 17:58:46 -07:00
Karoy Lorentey 2e276ba42b [PersistentCollections] Clean up _Node.Builder & removals
This sanitizes the semantics of _Node.Builder, removing
the (unneccessary) need to pass around hash paths.

It also slightly refactors removal operations, but stops short of
implementing node shrinking.

# Conflicts:
#	Sources/PersistentCollections/Node/_Node+Builder.swift
#	Sources/PersistentCollections/Node/_Node+Initializers.swift
#	Sources/PersistentCollections/Node/_Node+Structural intersection.swift
#	Sources/PersistentCollections/Node/_Node+Structural subtracting.swift
#	Sources/PersistentCollections/Node/_Node+Subtree Modify.swift
#	Sources/PersistentCollections/Node/_Node+Subtree Removals.swift
#	Sources/PersistentCollections/PersistentDictionary/PersistentDictionary+Initializers.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra Initializers.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra intersection.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra subtracting.swift

(cherry picked from commit c73a8caad1)
2022-10-19 17:58:46 -07:00
Karoy Lorentey 3c6cb8cd56 Update CMake configuration 2022-10-19 17:35:13 -07:00
Karoy Lorentey 381cf5d17e Merge branch 'release/1.0' into release/1.1 2022-10-19 15:50:34 -07:00
Karoy Lorentey 734730d724 [OrderedSet] Split SetAlgebra predicates into individual files
This is to match the layout of all the other
SetAlgebra implementations in this package.
2022-10-19 15:20:30 -07:00
Karoy Lorentey 5dfd51238c [OrderedSet] Review, test, fix, and document set relation predicates 2022-10-19 15:20:30 -07:00
Karoy Lorentey 8ce8a6bc86 [PersistentSet] Review, test, fix, and document set relation predicates 2022-10-19 15:20:17 -07:00
Karoy Lorentey f843bd40bf [PersistentSet] Add update(_:at:) 2022-10-19 15:20:17 -07:00
Karoy Lorentey 001df8e325 [BitSet] Review, test, fix, and document set relation predicates
- Update documentation
- Improve performance where possible
- Add missing test coverage where needed
2022-10-19 15:20:17 -07:00
Saleem Abdulrasool 5e0a0149a4 Update CMakeLists.txt
Remove missing file.  Thanks to @stevenbrix for identifying this!
2022-10-19 11:14:47 -07:00
Karoy Lorentey 291623d391 [BitSet] Implement isEqual(to:) family of functions 2022-10-19 01:40:06 -07:00
Karoy Lorentey 86d429604c [BitSet] Doc updates 2022-10-19 01:40:06 -07:00
Karoy Lorentey 51a1554f89 Introduce _UniqueCollection & _SortedCollection
These marker-like protocols will allow certain
generic operations to get a performance boost
if the passed-in value happens to be guaranteed
to contain unique elements or to be sorted.

Also, review API checker protocols for Sets and
sorted collections and adjust things as needed.

BitSet gains custom implementations for min()
and max() as part of these improvements.
2022-10-19 01:40:06 -07:00
Karoy Lorentey f76630db8e [Internals] Add missing internal checking predicates & docs for all 2022-10-18 22:13:19 -07:00
Karoy Lorentey 2b4ec22949 [OrderedSet] Small doc updates/fixes 2022-10-18 22:03:29 -07:00
Karoy Lorentey 5b5651957b [PersistentSet] Doc updates 2022-10-18 21:57:46 -07:00
Karoy Lorentey 02ea4e8492 [_CollectionsTestSupport] Move StringConvertibleValue under Utilities 2022-10-18 21:44:24 -07:00
Karoy Lorentey fc8092d044 [Heap] Small preparation for improving insert(contentsOf:) 2022-10-14 10:34:58 -07:00
Karoy Lorentey 23858475ef Merge pull request #207 from lorentey/PersistentCollections-updates3
Persistent collections updates (part 10)
2022-10-14 10:23:12 -07:00
Karoy Lorentey 2e9447fb1c [_CollectionsTestSupport] Richer support for combinatorial testing 2022-10-13 15:45:08 -07:00
Karoy Lorentey dc01b52a21 [Heap] Fix stray character in COLLECTION_INTERNAL_CHECKS condition 2022-10-13 14:51:04 -07:00
Karoy Lorentey fbebb69a1b [Heap] Doc updates 2022-10-13 14:50:18 -07:00
Karoy Lorentey 5a712f4cfc Merge pull request #208 from lorentey/heap-replace-min-max
[Heap] Add methods to replace minimum/maximum (redux)
2022-10-12 16:25:20 -07:00
Karoy Lorentey 1228e9c162 [Heap] Update docs for replaceMin/replaceMax 2022-10-12 16:01:48 -07:00
Karoy Lorentey 7138144f37 [Heap] Remove unnecessary testing APIs
We do not need a _raw initializer in the Heap implementation. The
heapify algorithm will not modify storage if it’s already in the
expected shape, so we can simply define one locally that double checks
that the order remains unchanged.
2022-10-12 16:01:23 -07:00
Karoy Lorentey 92d808d179 Merge branch 'heap-replace-extrema' into release/1.1 2022-10-12 15:23:17 -07:00
Karoy Lorentey 51604cd196 [OrderedCollections] Oops, restore custom wording for areInIncreasingOrder variants 2022-10-12 15:11:57 -07:00
Karoy Lorentey 4c842df1b8 [PersistentCollections] Fix up code added since c73a8caa originally landed 2022-10-12 15:08:22 -07:00
Karoy Lorentey e153ebf798 [PersistentCollections] Reduce popcount usages where possible
# Conflicts:
#	Sources/PersistentCollections/Node/_Node+Primitive Removals.swift
2022-10-12 13:19:41 -07:00
Karoy Lorentey 785caa4a55 [PersistentCollections] Slightly more readable index descriptions 2022-10-12 13:05:59 -07:00
Karoy Lorentey c73a8caad1 [PersistentCollections] Clean up _Node.Builder & removals
This sanitizes the semantics of _Node.Builder, removing
the (unneccessary) need to pass around hash paths.

It also slightly refactors removal operations, but stops short of
implementing node shrinking.

# Conflicts:
#	Sources/PersistentCollections/Node/_Node+Builder.swift
#	Sources/PersistentCollections/Node/_Node+Initializers.swift
#	Sources/PersistentCollections/Node/_Node+Structural intersection.swift
#	Sources/PersistentCollections/Node/_Node+Structural subtracting.swift
#	Sources/PersistentCollections/Node/_Node+Subtree Modify.swift
#	Sources/PersistentCollections/Node/_Node+Subtree Removals.swift
#	Sources/PersistentCollections/PersistentDictionary/PersistentDictionary+Initializers.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra Initializers.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra intersection.swift
#	Sources/PersistentCollections/PersistentSet/PersistentSet+SetAlgebra subtracting.swift
2022-10-12 13:05:58 -07:00
Karoy Lorentey b1506b6225 [SortedCollections] Remove for now
These are still on track for 1.2.0, but I’ll need to bump them from
the release/1.1 branch.
2022-10-11 17:55:35 -07:00
Saleem Abdulrasool 2a81cb1186 Update CMakeLists.txt
Remove accidental reference to CMakeLists.txt as a source file.
2022-10-11 13:46:20 -07:00
Karoy Lorentey a624614717 [OrderedCollections] Document that sort is stable (as of SE-0372) 2022-10-11 13:38:10 -07:00
Karoy Lorentey 5aed92655d [CMake] Update CMake build configuration 2022-10-11 13:11:37 -07:00
Karoy Lorentey 68844ec6d9 Integer Tricks → IntegerTricks 2022-10-11 13:11:28 -07:00
Karoy Lorentey 8b06c61c7e Merge branch 'release/1.0' into release/1.1 2022-10-11 11:24:28 -07:00
Karoy Lorentey 6286cd0b99 Restore support for building with Swift 5.5
This is mostly about adding more type declarations to deal with type checker limitations in the older compiler.
This also includes workarounds that allow better support for CodingKeyRepresentable in PersistentDictionary, and it fixes a couple of small oversights on various #else branches.
2022-10-10 18:07:49 -07:00
Karoy Lorentey 7cec5d1ed7 [_CollectionsUtilities] Work around SR-14663
Unfortunate edge case: the new `initialize(fromContentsOf:)` from
SE-0370 is calling withContiguousStorageIfAvailable, so it is subject
to SR-14663.

This means we can either choose to continue maintaining the
workaround, or we can call the stdlib’s implementation, but not both.
2022-10-10 17:23:22 -07:00
Karoy Lorentey 541bd53958 [BitCollections] Move shared utilities to _CollectionsUtilities 2022-10-09 20:11:51 -07:00
Karoy Lorentey 3d11356006 [OrderedSet] Move RAC utilities to _CollectionsUtilities module 2022-10-09 20:11:51 -07:00
Karoy Lorentey 48ac82c029 [Deque] Modernize code base for Swift 5.5 2022-10-09 20:11:51 -07:00
Karoy Lorentey 1b71d2cd94 [BitSet] Fix invariant violation in member subscript 2022-10-09 16:12:17 -07:00
Karoy Lorentey 33b759b842 [Heap] PriorityQueueModule → HeapModule 2022-10-09 15:44:44 -07:00
Karoy Lorentey 0b86bb11d2 [PersistentSet] Flesh out API surface
Add customary overloads for high-level Set operations.
2022-10-09 15:26:32 -07:00