Skip to content

Commit a78567a

Browse files
committed
Merge pull request #223 from weaksauce/master
Make documented complexity consistent
2 parents 9d74b1d + 14fdf74 commit a78567a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

stdlib/public/core/ArrayType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protocol _ArrayType
4545
/// - Postcondition: `capacity >= minimumCapacity` and the array has
4646
/// mutable contiguous storage.
4747
///
48-
/// - Complexity: O(`count`).
48+
/// - Complexity: O(`self.count`).
4949
mutating func reserveCapacity(minimumCapacity: Int)
5050

5151
/// Operator form of `appendContentsOf`.

stdlib/public/core/Arrays.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ extension ${Self} : _ArrayType {
618618
/// - Postcondition: `capacity >= minimumCapacity` and the array has
619619
/// mutable contiguous storage.
620620
///
621-
/// - Complexity: O(`count`).
621+
/// - Complexity: O(`self.count`).
622622
@_semantics("array.mutate_unknown")
623623
public mutating func reserveCapacity(minimumCapacity: Int) {
624624
if _buffer.requestUniqueMutableBackingBuffer(minimumCapacity) == nil {
@@ -722,7 +722,7 @@ extension ${Self} : _ArrayType {
722722
///
723723
/// - Requires: `i <= count`.
724724
///
725-
/// - Complexity: O(`count`).
725+
/// - Complexity: O(`self.count`).
726726
public mutating func insert(newElement: Element, atIndex i: Int) {
727727
_checkIndex(i)
728728
self.replaceRange(i..<i, with: CollectionOfOne(newElement))
@@ -732,7 +732,7 @@ extension ${Self} : _ArrayType {
732732
///
733733
/// Invalidates all indices with respect to `self`.
734734
///
735-
/// - Complexity: O(`count`).
735+
/// - Complexity: O(`self.count`).
736736
public mutating func removeAtIndex(index: Int) -> Element {
737737
let result = self[index]
738738
self.replaceRange(index..<(index + 1), with: EmptyCollection())

stdlib/public/core/HashedCollections.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ public struct Dictionary<Key : Hashable, Value> :
10781078
///
10791079
/// Invalidates all indices with respect to `self`.
10801080
///
1081-
/// - Complexity: O(`count`).
1081+
/// - Complexity: O(`self.count`).
10821082
public mutating func removeAtIndex(index: Index) -> Element {
10831083
return _variantStorage.removeAtIndex(index)
10841084
}
@@ -1101,7 +1101,7 @@ public struct Dictionary<Key : Hashable, Value> :
11011101
/// storage capacity that the collection has, otherwise the underlying
11021102
/// storage is released. The default is `false`.
11031103
///
1104-
/// Complexity: O(`count`).
1104+
/// Complexity: O(`self.count`).
11051105
public mutating func removeAll(keepCapacity keepCapacity: Bool = false) {
11061106
// The 'will not decrease' part in the documentation comment is worded very
11071107
// carefully. The capacity can increase if we replace Cocoa storage with

0 commit comments

Comments
 (0)