Commit Graph
86 Commits
Author SHA1 Message Date
Michael Steindorfer 3803970073 [Capsule] Fix compaction upon delete with SizePredicate 2022-08-09 17:20:28 +02:00
Michael Steindorfer 4c7149f03d [Capsule] Experiment with any nodes API 2022-08-09 17:20:28 +02:00
Michael Steindorfer e6365db080 [Capsule] Adopt Swift naming convention for chaining methods 2022-08-09 17:20:28 +02:00
Michael Steindorfer 2ac27e669a [Capsule] Rework hash-collision logic based on monomorphic trie nodes 2022-08-09 17:20:28 +02:00
Michael Steindorfer 21c0c0ef87 [Capsule] Prepare introduction of collMap 2022-08-09 17:20:28 +02:00
Michael Steindorfer 2c0b7d744f [Capsule] Generalize bitmap usage with typealias
* Turns computed properties into constants.
* Validate `Bitmap` and `BitPartitionSize` fit together.
2022-08-09 17:20:28 +02:00
Michael Steindorfer ec017cba3a [Capsule] Use larger chunk size for more shallow tries 2022-08-09 17:20:28 +02:00
Michael Steindorfer 2be8545840 [Capsule] Use overflowing bit-wise operations 2022-08-09 17:20:28 +02:00
Michael Steindorfer 72950a90f3 [Capsule] Fix Copy-On-Write semantics for nested nodes 2022-08-09 17:20:28 +02:00
Michael Steindorfer b175001db2 [Capsule] Add support for Copy-On-Write
This is work-in-progress, since it's not yet working deeper in the tree.
2022-08-09 17:20:28 +02:00
Michael Steindorfer 212fa0eb98 [Capsule] Update copyright headers 2022-08-09 17:20:28 +02:00
Michael Steindorfer b34c8dad97 [Capsule] Implement Equatable protocol 2022-08-09 17:20:28 +02:00
Michael Steindorfer 8e2ec3c49b [Capsule] Make copyAndSetNode generic 2022-08-09 17:20:28 +02:00
Michael Steindorfer d4ecaa0f75 [Capsule] Make spine of trie monomorphic 2022-08-09 17:20:28 +02:00
Michael Steindorfer e09c8db428 [Capsule] Implement preliminary hash-collision resolution 2022-08-09 17:20:28 +02:00
Michael Steindorfer b518d56b65 [Capsule] Implement Hashable extension for HashMap 2022-08-09 17:20:28 +02:00
Michael Steindorfer ce5a6bd71a [Capsule] Update copyright headers
Correctly reflects refining edits as well and not only initial draft date.
2022-08-09 17:20:28 +02:00
Michael Steindorfer b3e1e9d446 [Capsule] Harmonize identation 2022-08-09 17:20:28 +02:00
Michael Steindorfer 1598e22e45 [Capsule] Split nested structs and classes into separate files 2022-08-09 17:20:28 +02:00
Michael Steindorfer 88051725bb [Capsule] Rename Common.swift -> _Common.swift 2022-08-09 17:20:28 +02:00
Michael Steindorfer 3cb6fb3251 [Capsule] Split HashMap extensions into separate files 2022-08-09 17:20:28 +02:00
Michael Steindorfer 097e6b75b7 [Capsule] Update copyright headers 2022-08-09 17:20:28 +02:00
Michael Steindorfer 03913fd745 [Capsule] Increase visibility of count and subscript to public 2022-08-09 17:20:28 +02:00
Michael Steindorfer 488322edff [Capsule] Import sources 2022-08-09 17:20:28 +02:00
Karoy Lorentey 29120ea640 Merge branch 'release/1.0' 2022-02-09 11:56:38 -08:00
Karoy Lorentey 50e6a1ac71 [OrderedDictionary] Fix type inference issue with OrderedDictionary.init(grouping:by:)
This adds a new overload to help the type checker infer `[S.Element]` as the default `Value` type.

Resolves #139.
2022-02-08 14:16:18 -08:00
Karoy Lorentey 286fedb1e8 Merge branch 'release/1.0' 2021-11-15 17:01:49 -08:00
Károly Lőrentey efefae5653 [Deque] append(contentsOf:): Use exponential capacity reservation
Depending on the supplied sequence, `Deque.append(contentsOf:)` currently reserves just enough capacity as it needs to perform the append. This isn't right -- it can result in O(n) reallocs instead of O(log(n)) when items are incrementally appended in constant-sized `append(contents:)` batches.
2021-11-15 16:12:28 -08:00
Károly Lőrentey 074b0ad213 [OrderedSet] Add missing uniqueness check in OrderedSet._insertNew(_:at:in:) 2021-11-11 00:40:01 -08:00
Károly Lőrentey 13b5889757 [OrderedCollections][test] Strengthen withHiddenCopies tests
`withHiddenCopies(if:of:)` is supposed to check for value semantic violations where mutations of one copy affect another -- however, it currently only checks that iteration returns the same items before/after the change, not that the old copy is still in a fully consistent state.

Add an extra parameter that can be set to a closure that performs stricter checks.

Use it to call `_checkInvariants()` in ordered collections tests, uncovering a missing uniqueness check in `OrderedSet._insertNew(_:at:in:)`.
2021-11-11 00:39:29 -08:00
Saleem Abdulrasool 1c1e6206fa Update CMakeLists.txt
Remove `Heap+OrderedViews.swift` from the source list after #119.
2021-10-22 15:08:52 -07:00
Karoy Lorentey aba079126e Merge pull request #119 from lorentey/remove-heap-views
[Heap] Remove Heap's `ascending` and `descending` views
2021-10-20 11:56:00 -07:00
Karoy Lorentey 30e6eb1116 [Heap] Remove Heap's ascending and descending views
These two do *very* non-trivial processing, so they don't at all work like views in the Standard Library.

They also don't carry their weight -- they are simply lightweight wrappers around `popMin` and `popMax`, respectively.

Let's get rid of them before we etch them in stone as public API.
2021-10-11 14:50:08 -07:00
Saleem Abdulrasool 95be379a3a PriorityQueueModule: remove import Foundation
This removes an accidental dependency on Foundation.
2021-10-11 13:04:22 -07:00
Karoy Lorentey 7f57a0ed1c [OrderedSet][doc] Fix thinko 2021-09-14 11:50:31 -07:00
Karoy Lorentey 5f255a887e Merge branch 'release/1.0' 2021-09-10 11:58:12 -07:00
Karoy Lorentey f69104b507 [OrderedSet] Don't set a default value for the primary initializer's second argument
This will hopefully prevent issues like the one fixed in the previous commit from reoccurring in the future.
2021-09-09 16:44:06 -07:00
Karoy Lorentey e4f62c1520 [OrderedSet] Don't let the unchecked init create large sets with no hash table
In debug builds, the `OrderedSet.init(uncheckedUniqueElements:)` initializer always created a set with no hash table, even if it had an element count >15. This is technically an invariant violation (caught by `_checkInvariants()`), although it generally only triggers (very) slow performance. (The set reverts to linear searching.)
2021-09-09 16:44:06 -07:00
Karoy Lorentey 96100d4b6a [NFC] Cosmetic/doc updates 2021-09-08 21:12:52 -07:00
Karoy Lorentey e959a64528 [OrderedDictionary] Add some more _checkInvariants() calls 2021-09-08 21:12:52 -07:00
Karoy Lorentey 1ae008a410 [OrderedSet] Make _checkInvariants public and call it in more operations
It seems useful to be able to manually call `_checkInvariants` while debugging a package issue. This is public as in `public`, not public as in Public API -- it's underscored.
2021-09-08 21:12:52 -07:00
Karoy Lorentey 9d4bb8cdf8 [OrderedDictionary] Remove deprecated API
Mark the deprecated `subscript(offset:)` and `modifyValue(...)` APIs unavailable and replace their bodies with fatalError().
2021-09-03 19:11:29 -07:00
Karoy Lorentey f1f48d569a [test] CollectionsTestSupport → _CollectionsTestSupport
The underscored module name makes it clear that this isn't public API.
2021-09-03 15:57:09 -07:00
ejmarchant 4c22d00065 Follow stdlib's leading underscore rule (#95) 2021-08-30 15:44:27 -07:00
Edward Marchant 751ae1b08b Documentation: Remove in-place mutation comments 2021-08-30 15:44:27 -07:00
ejmarchant 5762a3a50c Follow stdlib's leading underscore rule (#95) 2021-08-30 15:32:50 -07:00
Karoy Lorentey 837a273bef Also freeze Heap types 2021-08-30 15:31:25 -07:00
Karoy Lorentey 0e9e7f13e4 Freeze some types for consistency with their inlinable initializers
Note: @frozen does *not* mean that we actually consider these struct types frozen. Their layout may arbitrarily change between even minor releases.
2021-08-30 15:31:25 -07:00
Karoy Lorentey 56b82b1b7f Freeze some types for consistency with their inlinable initializers
Note: @frozen does *not* mean that we actually consider these struct types frozen. Their layout may arbitrarily change between even minor releases.
2021-08-30 15:31:12 -07:00
Edward Marchant 215ed90386 Documentation: Remove in-place mutation comments 2021-08-30 15:27:14 -07:00