Karoy Lorentey
69768b6eac
[OrderedCollections, BitCollections] Fix more warnings in development versions of Swift
2022-11-28 21:53:06 -08:00
Karoy Lorentey
a2f4b18ae0
[BitSet, OrderedCollections] Unify UnsafeBitSet implementations
2022-11-28 16:30:55 -08:00
Karoy Lorentey
8f7d5fd505
[SetAlgebra types] isEqual(to:) → isEqualSet(to:)
...
The `isEqual(to:)` methods are a bit too confusing — they implement
mathematical set comparisons (ignoring element ordering and, in the
case of the Sequence variant, even element multiplicities), so it
seems better to highlight this by putting a `Set` in the name.
2022-10-31 15:05:12 -07:00
Karoy Lorentey
aaeeb9e440
[OrderedCollections] Doc updates
2022-10-28 12:34:14 -07:00
Karoy Lorentey
de22bed429
[OrderedCollections] Update top-level docs
2022-10-28 12:34:14 -07:00
Karoy Lorentey
a9fd8af830
Merge pull request #225 from lorentey/fix-custom-mirrors
...
[OrderedSet, BitSet] Fix custom mirror display style
2022-10-28 12:20:49 -07:00
Karoy Lorentey
207029a613
[OrderedSet] Improve Sequence initializer
2022-10-27 18:32:06 -07:00
Karoy Lorentey
2dae70dba7
[OrderedSet, BitSet] Fix display style of custom mirror
2022-10-27 18:29:32 -07:00
Karoy Lorentey
0914e6f546
[OrderedSet] More test coverage for set operations; clarify docs
2022-10-21 18:24:08 -07:00
Karoy Lorentey
3a07b859e0
[OrderedSet] Split SetAlgebra binary operations into individual files
2022-10-21 18:24:08 -07:00
Karoy Lorentey
7143421800
[OrderedCollections] Add missing Custom[Debug]StringConvertable conformances, review existing ones
...
Add `Custom[Debug]StringConvertible` conformance on:
- `OrderedDictionary.Values`
- `OrderedDictionary.Elements.Subsequence`
- `OrderedSet.SubSequence`
2022-10-20 17:14:52 -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
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
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
8b06c61c7e
Merge branch 'release/1.0' into release/1.1
2022-10-11 11:24:28 -07:00
Karoy Lorentey
3d11356006
[OrderedSet] Move RAC utilities to _CollectionsUtilities module
2022-10-09 20:11:51 -07:00
Karoy Lorentey
82aae27cff
[OrderedSet] OrderedSet, .SubSequence, .UnorderedView, .UnstableInternals: Explicitly conform to Sendable when Element is Sendable
2022-10-05 11:39:03 -07:00
Karoy Lorentey
66651795d8
[OrderedSet] Tiny doc fixes for isSuperset.
2022-09-29 17:56:55 -07:00
Karoy Lorentey
19c9f282c9
Delete _FastMembershipCheckable
...
We don’t actually need this, as `_customContainsEquatableElement`
returning non-nil is a perfectly suitable indication that containment
checking is fast.
2022-09-29 17:37:48 -07:00
Karoy Lorentey
3d10964905
[PersistentSet] Flesh out isSubset/iSuperset/isDisjoint/etc overloads (untested)
...
This adds an experimental _FastMembershipCheckable protocol to speed
up these relationship predicates when possible — having separate
overloads for each known collection with a fast containment check
is not going to scale for long.
This commit also introduces a set of isEqual(to:) methods that
generalize ==.
2022-09-24 17:02:16 -07:00
Karoy Lorentey
12e3867ccb
[Collections] Allow determining if internal checking is enabled
...
In the benchmark target, complain loudly if consistency checks
are enabled.
2022-09-19 21:25:07 -07:00
Karoy Lorentey
77edbef16d
[_CollectionsUtilities] Restore original debug descriptions
2022-09-13 23:45:22 -07:00
Karoy Lorentey
dd76591970
[_CollectionsUtilities] New module. Use it to unify description/debugDescription implementations
2022-09-12 12:47:04 -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
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
ee1b2de06e
[OrderedCollections] Force-inline all _modify accessors
2022-08-31 15:31:42 -07:00
Karoy Lorentey
c3fdcf746e
Merge pull request #163 from ktoso/wip-filter-set
...
=OrderedSet.filter Attempt to optimize filter impl
2022-08-18 10:52:29 -07:00
Karoy Lorentey
3bf91b1ee4
Remove hash lookups while filtering
2022-08-17 22:57:37 -07:00
Konrad `ktoso` Malawski
f56388e4f7
=OrderedSet.filter Attempt to optimize filter impl
2022-08-18 10:28:20 +09:00
Karoy Lorentey
1071b37294
[OrderedSet] Work around weird name lookup issue in compiler
...
Resolves #157 .
2022-08-17 17:37:53 -07:00
Konrad `ktoso` Malawski and Xiaodi Wu
74a800ac53
Apply suggestions from code review
...
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com >
2022-08-17 12:21:02 +09:00
Konrad `ktoso` Malawski
f8726ce33f
checkInvariants
2022-08-17 11:01:03 +09:00
Konrad `ktoso` Malawski
6142869b83
+OrderedSet add filter #158
2022-08-16 20:37:44 +09:00
Károly Lőrentey
074b0ad213
[OrderedSet] Add missing uniqueness check in OrderedSet._insertNew(_:at:in:)
2021-11-11 00:40:01 -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
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
ejmarchant
4c22d00065
Follow stdlib's leading underscore rule ( #95 )
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
ejmarchant
5ff8c003b0
Fix documentation for types conforming to ExpressibleByArrayLiteral or ExpressibleByDictionaryLiteral ( #82 )
...
# Conflicts:
# Sources/PriorityQueueModule/Heap+ExpressibleByArrayLiteral.swift
2021-08-19 19:26:41 -07:00
Rodrigo Kreutz
c0549b6284
Fixing a small typo on quick help documentation. ( #55 )
2021-06-12 12:06:19 -07:00
François Lamboley
f6d8f82627
Replace Index with Int where possible ( #32 )
2021-05-10 16:36:10 -07:00
Kiel Gillard
0096c5b39d
Add the @discardableResult attribute to OrderedSet.insert(_:at:) ( #21 )
...
* Add the @discardableResult attribute to OrderedSet.insert(_:at:). Fixes #19
* Add the @discardableResult attribute to OrderedSet.updateOrAppend(_).
* Add the @discardableResult attribute to OrderedSet.updateOrInsert(_:at:).
2021-04-13 19:03:56 -07:00