From 75395832459d3e7a05ec51ca2ea081fe99be5e8e Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Sun, 4 Feb 2024 20:35:42 +0200 Subject: [PATCH] Fix typos # Conflicts: # Sources/SortedCollections/BTree/_BTree+BidirectionalCollection.swift # Sources/SortedCollections/BTree/_BTree+UnsafeCursor.swift # Sources/SortedCollections/BTree/_BTree.Builder.swift # Sources/SortedCollections/BTree/_BTree.swift # Sources/SortedCollections/BTree/_Node.Splinter.swift # Sources/SortedCollections/BTree/_Node.Storage.swift # Sources/SortedCollections/BTree/_Node.UnsafeHandle+Insertion.swift # Sources/SortedCollections/BTree/_Node.swift # Tests/SortedCollectionsTests/BTree/Node+Join Tests.swift --- Sources/DequeModule/_UnsafeWrappedBuffer.swift | 2 +- Sources/HashTreeCollections/HashNode/_UnsafePath.swift | 2 +- .../TreeSet/TreeSet+ExpressibleByArrayLiteral.swift | 2 +- .../HashTable/_HashTable+BucketIterator.swift | 2 +- Sources/OrderedCollections/OrderedSet/OrderedSet.swift | 2 +- .../BigString/Chunk/BigString+Chunk+Description.swift | 2 +- Sources/RopeModule/Rope/Basics/RopeMetric.swift | 2 +- Tests/RopeModuleTests/TestBigString.swift | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/DequeModule/_UnsafeWrappedBuffer.swift b/Sources/DequeModule/_UnsafeWrappedBuffer.swift index e6f3adea..b51a5cac 100644 --- a/Sources/DequeModule/_UnsafeWrappedBuffer.swift +++ b/Sources/DequeModule/_UnsafeWrappedBuffer.swift @@ -199,7 +199,7 @@ extension _UnsafeMutableWrappedBuffer { // Note: Array._copyContents traps when not given enough space, so we // need to check if we have enough contiguous space available above. // - // FIXME: Add suppport for segmented (a.k.a. piecewise contiguous) + // FIXME: Add support for segmented (a.k.a. piecewise contiguous) // collections to the stdlib. var (it, copied) = elements._copyContents(initializing: first) if copied == first.count, let second = second { diff --git a/Sources/HashTreeCollections/HashNode/_UnsafePath.swift b/Sources/HashTreeCollections/HashNode/_UnsafePath.swift index 3e0a3900..a434c15d 100644 --- a/Sources/HashTreeCollections/HashNode/_UnsafePath.swift +++ b/Sources/HashTreeCollections/HashNode/_UnsafePath.swift @@ -874,7 +874,7 @@ extension _RawHashNode { } distance += c } - // See if the target is hiding somwhere in our immediate items. + // See if the target is hiding somewhere in our immediate items. distance &+= $0.itemCount if distance >= 0 { path.selectItem(at: _HashSlot(distance)) diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+ExpressibleByArrayLiteral.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+ExpressibleByArrayLiteral.swift index 4fb84756..ce74752c 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+ExpressibleByArrayLiteral.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+ExpressibleByArrayLiteral.swift @@ -18,7 +18,7 @@ extension TreeSet: ExpressibleByArrayLiteral { /// Do not call this initializer directly. It is used by the compiler when /// you use an array literal. Instead, create a new persistent set using an /// array literal as its value by enclosing a comma-separated list of values - /// in square brackets. You can use an array literal anywhere a peristent set + /// in square brackets. You can use an array literal anywhere a persistent set /// is expected by the type context. /// /// Like the standard `Set`, persistent sets do not preserve the order of diff --git a/Sources/OrderedCollections/HashTable/_HashTable+BucketIterator.swift b/Sources/OrderedCollections/HashTable/_HashTable+BucketIterator.swift index c651031d..6ed5165d 100644 --- a/Sources/OrderedCollections/HashTable/_HashTable+BucketIterator.swift +++ b/Sources/OrderedCollections/HashTable/_HashTable+BucketIterator.swift @@ -14,7 +14,7 @@ extension _HashTable { /// table. This is a convenient tool for implementing linear probing. /// /// Beyond merely providing bucket values, bucket iterators can also tell - /// you their current oposition within the hash table, and (for mutable hash + /// you their current opposition within the hash table, and (for mutable hash /// tables) they allow you update the value of the currently visited bucket. /// (This is useful when implementing simple insertions, for example.) /// diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet.swift index ad6bff9d..67f3958b 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet.swift @@ -240,7 +240,7 @@ import _CollectionsUtilities /// The hash table in an ordered set never needs to store larger indices than /// the current size of the storage array, and `OrderedSet` makes use of this /// observation to reduce the number of bits it uses to encode these integer -/// vaues. Additionally, the actual hashed elements are stored in a flat array +/// values. Additionally, the actual hashed elements are stored in a flat array /// value rather than the hash table itself, so they aren't subject to the hash /// table's strict maximum load factor. These two observations combine to /// optimize the memory utilization of `OrderedSet`, sometimes making it even diff --git a/Sources/RopeModule/BigString/Chunk/BigString+Chunk+Description.swift b/Sources/RopeModule/BigString/Chunk/BigString+Chunk+Description.swift index d8ce25f4..c44a3766 100644 --- a/Sources/RopeModule/BigString/Chunk/BigString+Chunk+Description.swift +++ b/Sources/RopeModule/BigString/Chunk/BigString+Chunk+Description.swift @@ -34,7 +34,7 @@ extension BigString._Chunk: CustomStringConvertible { func _succinctContents(maxLength c: Int) -> String { /// 4+"short"-1 - /// 0+"longer...tring"-1 + /// 0+"longer...string"-1 let pc = String(prefixCount)._lpad(to: 3) let sc = String(suffixCount) diff --git a/Sources/RopeModule/Rope/Basics/RopeMetric.swift b/Sources/RopeModule/Rope/Basics/RopeMetric.swift index 16ff34e1..c39e1b92 100644 --- a/Sources/RopeModule/Rope/Basics/RopeMetric.swift +++ b/Sources/RopeModule/Rope/Basics/RopeMetric.swift @@ -20,7 +20,7 @@ public protocol RopeMetric: Sendable { /// /// - Parameter offset: An integer offset from the start of `element` in this /// metric, not exceeding `size(of: element.summary)`. - /// - Parameter element: An arbitary rope element. + /// - Parameter element: An arbitrary rope element. /// - Returns: The index addressing the desired position in the input element. func index(at offset: Int, in element: Element) -> Element.Index } diff --git a/Tests/RopeModuleTests/TestBigString.swift b/Tests/RopeModuleTests/TestBigString.swift index 645633cf..84067d44 100644 --- a/Tests/RopeModuleTests/TestBigString.swift +++ b/Tests/RopeModuleTests/TestBigString.swift @@ -968,7 +968,7 @@ class TestBigString: CollectionTestCase { let b1: BigString = "Foobar" var s1 = b1.suffix(3) expectEqual(s1, "bar") - s1.insert("\u{308}", at: s1.startIndex) // Combining diaresis + s1.insert("\u{308}", at: s1.startIndex) // Combining diaeresis expectEqual(s1.base, "Foöbar") expectEqual(s1, "öbar")