Karoy Lorentey
e10396bb20
[Heap] Convert min() and max() to properties
2023-11-14 18:52:27 -08:00
Karoy Lorentey
33e2e610f5
Merge branch 'release/1.0' into release/1.1
...
# Conflicts:
# Tests/_CollectionsTestSupport/MinimalTypes/MinimalDecoder.swift
2023-11-14 18:06:24 -08:00
Karoy Lorentey
c44d56f4c8
Merge pull request #327 from lorentey/heap-better-bulk-insert
...
[Heap] insert(contentsOf:) Switch to Floyd’s if we’re inserting too many items
2023-11-14 17:56:22 -08:00
Karoy Lorentey and Stephen Canon
19ec155f60
Update Sources/HeapModule/Heap.swift
...
Co-authored-by: Stephen Canon <stephentyrone@gmail.com >
2023-11-14 11:06:05 -08:00
Karoy Lorentey
069dd4e5df
[Heap] insert(contentsOf:) Switch to Floyd’s if we’re inserting too many items
2023-11-13 21:28:24 -08:00
Karoy Lorentey
7686af1555
[Heap] Improve type-level doc comment
2023-11-13 18:33:43 -08:00
kati-kms
b72a6cfd93
Fix typos: OrderedSet.swift DocC
2023-11-10 15:38:16 +09:00
Karoy Lorentey
33f23b6a06
[RopeModule] Remove unnecessary typealiases
...
These render the emitted .swiftinterface unusable when the module is built with library evolution enabled.
2023-10-18 17:57:00 -07:00
Karoy Lorentey
bd1a622735
[CMake, Xcode] Update buid configurations
2023-10-18 15:54:07 -07:00
Karoy Lorentey
9436aab34c
[HashTreeCollections] _StorageHeader.swift → _HashNodeHeader.swift
2023-10-18 15:52:05 -07:00
Karoy Lorentey
de2c8a9086
[RopeModule] Allow building with library evolution enabled
...
rdar://114659667
2023-10-18 14:22:12 -07:00
Karoy Lorentey
bf742617f3
[test] Fix typename shadowing warning in Swift 5.9
2023-10-02 21:09:11 -07:00
Karoy Lorentey
09c09f0f73
Fix CustomStringConvertible/CustomDebugStringConvertible conformances
...
- For CustomStringConvertible, `description` should print elements using `String(reflecting:)` rather than `String(describing:)`, to avoid element output from interfering with syntactically relevant punctuation within structured list displays.
- To make this work without making displays overly verbose, make `debugDescription` mostly the same as `description`, except for escaping raw string displays when and if needed.
- Avoid printing type names in `debugDescription` — it is generally not helpful, as the type is already easily accessible elsewhere. Including it makes for overly verbose displays when the type serves as an Element of a collection.
- Avoid having `debugDescription` return the empty string — it can be confusing when such a description appears in list displays.
Resolves #301 .
2023-07-06 17:25:11 -07:00
Joakim Hassila
b3d089e37d
Update TreeSet.md
...
Fix typo
Replace this paragraph with a description of your changes and rationale. Provide links to an existing issue or external references/discussions, if appropriate.
2023-06-21 09:42:04 +02:00
Karoy Lorentey
03e7f0c401
[Rope] Fix find to return a zero remainder for the end position
2023-06-02 17:37:30 -07:00
Karoy Lorentey
03c9ef743a
[Rope] Fix crash when calling replaceSubrange/removeSubrange on an empty rope
2023-06-01 20:24:24 -07:00
Karoy Lorentey
523a409ba4
Merge pull request #287 from lorentey/fix-BitSet-isEqualSet
...
[BitSet] Fix a thinko in BitSet.isEqualSet
2023-05-18 19:09:33 -07:00
Karoy Lorentey
de0f594185
[BitSet] Fix a thinko in BitSet.isEqualSet
2023-05-18 18:36:29 -07:00
Karoy Lorentey
0c002200bb
[CollectionUtilities] Silence a warning on 32 bit platforms
...
It turns out `UInt.bitWidth` is getting too eagerly inlined, so conditions based on it trigger spurious “code will never be executed” warnings. Silence those by switching to looking at `MemoryLayout<UInt>`, which doesn’t get turned into a constant *that* early.
2023-05-18 18:32:41 -07:00
Karoy Lorentey
3e4a8b4dff
Merge branch 'release/1.0' into release/1.1
...
# Conflicts:
# .gitignore
# Package.swift
# Sources/Collections/Collections.docc/Collections.md
# Sources/Collections/Collections.docc/Extensions/Deque.md
# Sources/Collections/Collections.docc/Extensions/OrderedSet.UnorderedView.md
# Sources/Collections/Collections.docc/Extensions/OrderedSet.md
# Sources/DequeModule/DequeModule.docc/DequeModule.md
# Sources/DequeModule/DequeModule.docc/Extensions/Deque.md
# Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift
# Sources/OrderedCollections/OrderedCollections.docc/Extensions/OrderedSet.UnorderedView.md
# Sources/OrderedCollections/OrderedCollections.docc/Extensions/OrderedSet.md
# Sources/OrderedCollections/OrderedCollections.docc/OrderedCollections.md
# Sources/OrderedCollections/OrderedDictionary/OrderedDictionary.swift
# Sources/OrderedCollections/OrderedSet/OrderedSet.swift
# Sources/OrderedCollections/Utilities/_UnsafeBitset.swift
# Utils/generate-docs.sh
2023-04-24 13:45:55 -07:00
Karoy Lorentey
dce7b156e7
[Rope] remove(at:): Fix assertion when removing the last item creates a deficiency
2023-04-17 17:20:07 -07:00
Karoy Lorentey
b0fe7ca8ba
[Rope] replaceSubrange: take a sequence, not a collection
2023-04-14 14:38:30 -07:00
Karoy Lorentey
3fa52c48de
[Rope] Add remove(at:), remove(at:in:) variants that preserve the position
2023-04-13 19:36:09 -07:00
Karoy Lorentey
1925ed3001
[Rope] update(at:by:): Invalidate indices
...
Calling this function is supposed to invalidate all indices other than
the input index — so let’s do that.
2023-04-12 17:55:19 -07:00
Karoy Lorentey
cead2b3d64
[Rope] index(_:offsetBy:in:preferEnd:) fix result tuple labeling
...
This renames `remainder` to `remaining`, restoring API consistency.
2023-04-12 17:54:13 -07:00
Karoy Lorentey
bc21b90ff1
[Rope] Minor usability fixes and API additions
2023-04-12 17:53:04 -07:00
Karoy Lorentey
4afdfe4da2
[Rope] Flesh out docs a little bit
...
Rope remains woefully undocumented, and I suspect its abstraction
level isn’t right for general use, but let’s see if writing up some
documentation for it will make it a bit more accessible.
2023-04-12 17:52:19 -07:00
Karoy Lorentey
b727b93f9b
Merge pull request #277 from lorentey/remove-swift-5.5-checks
...
Remove obsolete swift(>=5.5)/swift(>=5.6) checks
2023-04-10 18:45:31 -07:00
Karoy Lorentey
a8dad62bc9
Remove obsolete swift(>=5.5)/swift(>=5.6) checks
2023-04-10 18:33:52 -07:00
Karoy Lorentey
ac0c075ccc
[HashCollections] Ensure self doesn’t get destroyed before we’re done working with it
...
The HashCollections module includes several mutating methods that dereference unmanaged references to internal nodes after the last usage of `self`. Prevent the compiler from destroying `self` before we’re done working within descendants of its tree.
2023-04-10 18:24:33 -07:00
Karoy Lorentey
1ea846bcae
Merge pull request #275 from lorentey/ordereddictionary-doc-updates
...
[OrderedDictionary] Explicitly mention in documentation that keys/values are ordered
2023-04-10 17:45:21 -07:00
Karoy Lorentey
900e7851ab
Merge pull request #271 from lorentey/fix-rope-sendable
...
Rope: Fix `Sendable` conformance
2023-04-10 17:43:23 -07:00
Karoy Lorentey
7c17b02963
Merge pull request #272 from lorentey/fix-bigstring-utility
...
BigString: Fix String.Index._knownScalarAligned
2023-04-10 17:42:39 -07:00
Karoy Lorentey
64e940d9ff
Merge pull request #270 from lorentey/inlinable-ropes
...
Make most of Rope inlinable
2023-04-10 17:42:23 -07:00
Ryan McLeod
7f63914a71
[OrderedDictionary] Explicitly mention in documentation that keys/values are ordered
...
(cherry picked from commit fef3839500 )
2023-04-10 17:36:49 -07:00
Karoy Lorentey
8ca5c0367f
Merge pull request #263 from lorentey/bitcollections-finalization
...
BitArray API refinements & additions
2023-04-10 17:32:10 -07:00
Karoy Lorentey
454c84b5e4
Make most of Rope inlinable
2023-04-10 16:56:30 -07:00
Karoy Lorentey
96d7162888
BigString: Fix String.Index._knownScalarAligned
...
This member isn’t currently used, but unlike its counterpart in the stdlib, this one accidentally sets the character-alignment bit.
2023-04-10 16:50:37 -07:00
Karoy Lorentey
9c3328e235
Rope: Fix Sendable conformance
...
`Rope._Node` wasn’t declared `Sendable`, which triggered valid warnings.
2023-04-10 16:45:28 -07:00
Karoy Lorentey
73936bba69
Expose a handful of BigString.Index methods
...
These help implementing conversions between String.Index and BigString.Index.
2023-04-07 19:26:47 -07:00
Felix Herrmann
26de4aa094
Fix deprecated UnsafeMutablePointer.assign(repeating:count) method
2023-03-29 19:05:43 +02:00
Karoy Lorentey
3cbf81976d
Merge pull request #266 from lorentey/monomodule-support
...
Monomodule support
2023-03-23 13:54:45 -07:00
Karoy Lorentey
e6ecdac581
Fix off by one error in BitSet
2023-03-22 21:45:46 -07:00
Karoy Lorentey
f17cf642c1
Add support building with COLLECTIONS_SINGLE_MODULE
...
- Sources/_CollectionsTestSupport → Tests/_CollectionsTestSupport
- Refactor Package.swift to allow switching between the default
polymodule and the new monomodule product configurations
(by editing the manifest file).
- Fix build errors in the monomodule variant.
2023-03-22 21:44:23 -07:00
Karoy Lorentey
2453c1bc23
Also generate @usableFromInline attributes, as needed
2023-03-22 20:01:23 -07:00
Karoy Lorentey
c287334a9b
_CollectionsUtilities: Use gyb to allow defining these helpers as internal or public depending on COLLECTIONS_SINGLE_MODULE
...
This is a thoroughly disgusting solution, but needs must. 😞
Hopefully macros will let us eventually replace this mess.
2023-03-22 18:56:33 -07:00
Karoy Lorentey
e1ef053615
Stop mentioning the enclosing module’s name
2023-03-21 18:46:10 -07:00
Karoy Lorentey
ea60d293b4
Fix test issues with single-module variant
2023-03-21 18:43:46 -07:00
Karoy Lorentey
cbab9e3737
Introduce COLLECTIONS_SINGLE_MODULE condition
2023-03-21 18:42:33 -07:00
Karoy Lorentey
cc181a3bce
HeapModule: _Node → _HeapNode
...
This makes this name unique throughout the package, allowing this code to be built as a single, huge module.
2023-03-21 16:39:03 -07:00