77 Commits
Author SHA1 Message Date
Karoy Lorentey cdcf9e606a Update CMake configuration 2023-12-19 17:45:02 -08:00
Karoy Lorentey 9d4a1e5ad2 [OrderedSet] Don’t try to conform to Sendable below Swift 5.5 2023-12-19 17:10:37 -08:00
Karoy Lorentey 03d60bed63 Merge pull request #343 from lorentey/sendable-1.0
[1.0] Backport Sendable conformances on all public types
2023-12-18 18:43:30 -05:00
Karoy Lorentey 8bfcaddd5f [1.0] Update copyright dates 2023-12-18 15:35:56 -08:00
Karoy Lorentey 7d43c07a71 Backport Sendable conformances on all public types
Resolves #317
2023-12-18 15:25:38 -08:00
Karoy Lorentey 40e737cdaf [OrderedDictionary] Fix usage of deprecated API in index(forKey:) docs
Resolves #289.
2023-12-18 15:00:55 -08:00
Karoy Lorentey 1016901f5e Merge pull request #341 from vanvoorden/vanvoorden/deque-equality
[Deque] check deque equality with buffer identity
2023-12-12 21:54:46 -05:00
Karoy Lorentey 8b8a14f0e1 Merge pull request #340 from vanvoorden/vanvoorden/ordered-set-equality
[OrderedSet] forward ordered set equality to elements property
2023-12-12 21:54:30 -05:00
Rick van Voorden 2122327782 deque storage equality helper 2023-12-12 14:16:21 -08:00
Rick van Voorden e37e505da5 ordered set fix compiler error 2023-12-12 12:33:38 -08:00
Rick van VoordenandKaroy Lorentey 9430147598 ordered set bounds equality check
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2023-12-12 12:27:48 -08:00
Rick van VoordenandKaroy Lorentey 5fa8e440a2 remove extra test equality helper function
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2023-12-12 11:18:18 -08:00
Rick van Voorden 22306e061a check deque equality with buffer identity 2023-12-11 19:30:34 -08:00
Rick van Voorden e2b033c8ea forward ordered set subsequence equality to elements property 2023-12-11 15:24:07 -08:00
Rick van Voorden 3caf13b4f8 forward ordered set equality to elements property 2023-12-08 20:32:31 -08:00
Rick van Voorden e42fb868b7 forward ordered dictionary values equality to values property 2023-12-08 17:39:25 -08:00
kati-kms b72a6cfd93 Fix typos: OrderedSet.swift DocC 2023-11-10 15:38:16 +09:00
Karoy Lorentey bf742617f3 [test] Fix typename shadowing warning in Swift 5.9 2023-10-02 21:09:11 -07:00
Felix Herrmann 26de4aa094 Fix deprecated UnsafeMutablePointer.assign(repeating:count) method 2023-03-29 19:05:43 +02:00
Karoy Lorentey b4c1070741 [Docs] Update high-level Collections docs 2022-12-06 21:02:34 -08:00
Karoy Lorentey a874de5f7f [OrderedCollections] Refresh some docs with DocC links 2022-12-06 19:00:59 -08:00
Karoy Lorentey 08b38129b9 [OrderedSet] Fix outdated documentation 2022-12-06 18:41:29 -08:00
Karoy Lorentey 141c3939bf [DocC] Add documentation bundles for all three targets 2022-12-06 18:41:04 -08:00
Karoy Lorentey 2b4ec22949 [OrderedSet] Small doc updates/fixes 2022-10-18 22:03:29 -07:00
Karoy Lorentey 51604cd196 [OrderedCollections] Oops, restore custom wording for areInIncreasingOrder variants 2022-10-12 15:11:57 -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 66651795d8 [OrderedSet] Tiny doc fixes for isSuperset. 2022-09-29 17:56:55 -07:00
Karoy Lorentey a9e2276472 Merge pull request #168 from lorentey/cherry-pick-1.0.3
Cherry pick recent fixes to release/1.0 in preparation of tagging 1.0.3
2022-09-01 17:21:25 -07:00
Karoy Lorentey 71aa4a39ae [OrderedDictionary] Resolve spurious(?) call-site ambiguities 2022-08-31 17:57:24 -07:00
Karoy Lorentey b379fa7aee [OrderedCollections] Force-inline all _modify accessors
(cherry picked from commit ee1b2de06e)
2022-08-31 17:13:53 -07:00
Karoy Lorentey 87c78de6b4 [Deque] Force-inline the subscript’s _modify accessor to work around a performance issue
Resolves #164.

(cherry picked from commit 98cd753866)
2022-08-31 17:13:53 -07:00
Karoy Lorentey 6cbecdb467 [OrderedSet] Work around weird name lookup issue in compiler
Resolves #157.

(cherry picked from commit 1071b37294)
2022-08-31 17:13:53 -07:00
Karoy Lorentey d0f05d5cf5 [OrderedCollection] Use standard temp allocation facility, if available
The 5.6 stdlib introduced a new facility for temporary allocations
that promises better performance than direct allocations. Use it when
the toolchain version is above 5.6.

(cherry picked from commit ddb6d141b3)
2022-08-31 17:13:53 -07:00
Karoy Lorentey 6cb037037d [OrderedDictionary][doc] Update docs for merge/filter operations
Resolves #145
2022-05-23 16:17:35 -07: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
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
Karoy Lorentey 7f57a0ed1c [OrderedSet][doc] Fix thinko 2021-09-14 11:50:31 -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
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
Karoy Lorentey 9d8719c8be [OrderedDictionary] Deprecate subscript(offset:) for now (#92)
* [OrderedDictionary] Deprecate index(forKey:), subscript(offset:) and friends for now

* [OrderedDictionary] Update tests

* Update benchmarks

* Un-deprecate index(forKey:)
2021-08-19 19:26:41 -07:00