8000 Documentation/formatting · ole/SortedArray@feaf704 · GitHub
[go: up one dir, main page]

Skip to content

Commit feaf704

Browse files
committed
Documentation/formatting
1 parent e27ec45 commit feaf704

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

Sources/SortedArray.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,25 +164,25 @@ extension SortedArray {
164164
// swift(4.1.50): Swift 4.2 compiler in Swift 4 mode
165165
// swift(4.2): Swift 4.2 compiler
166166
#if !swift(>=4.1.50)
167-
/// Removes the elements in the specified subrange from the array.
168-
///
169-
/// - Parameter bounds: The range of the array to be removed. The
170-
/// bounds of the range must be valid indices of the array.
171-
///
172-
/// - Complexity: O(_n_), where _n_ is the length of the array.
173-
public mutating func removeSubrange(_ bounds: CountableRange<Int>) {
174-
_elements.removeSubrange(bounds)
175-
}
167+
/// Removes the elements in the specified subrange from the array.
168+
///
169+
/// - Parameter bounds: The range of the array to be removed. The
170+
/// bounds of the range must be valid indices of the array.
171+
///
172+
/// - Complexity: O(_n_), where _n_ is the length of the array.
173+
public mutating func removeSubrange(_ bounds: CountableRange<Int>) {
174+
_elements.removeSubrange(bounds)
175+
}
176176

177-
/// Removes the elements in the specified subrange from the array.
178-
///
179-
/// - Parameter bounds: The range of the array to be removed. The
180-
/// bounds of the range must be valid indices of the array.
181-
///
182-
/// - Complexity: O(_n_), where _n_ is the length of the array.
183-
public mutating func removeSubrange(_ bounds: CountableClosedRange<Int>) {
184-
_elements.removeSubrange(bounds)
185-
}
177+
/// Removes the elements in the specified subrange from the array.
178+
///
179+
/// - Parameter bounds: The range of the array to be removed. The
180+
/// bounds of the range must be valid indices of the array.
181+
///
182+
/// - Complexity: O(_n_), where _n_ is the length of the array.
183+
public mutating func removeSubrange(_ bounds: CountableClosedRange<Int>) {
184+
_elements.removeSubrange(bounds)
185+
}
186186
#endif
187187

188188
/// Removes the specified number of elements from the beginning of the

Tests/UnitTests/TestHelpers.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import XCTest
22

3+
// FIXME: Can be replaced with XCTAssertEqual when we drop Swift 4.0 compatibility
34
func assertElementsEqual<S1, S2>(_ expression1: @autoclosure () throws -> S1, _ expression2: @autoclosure () throws -> S2, _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line)
4-
where S1: Sequence, S2: Sequence, S1.Element == S2.Element, S1.Element: Equatable {
5-
5+
where S1: Sequence, S2: Sequence, S1.Element == S2.Element, S1.Element: Equatable
6+
{
67
// This should give a better error message than using XCTAssert(try expression1().elementsEqual(expression2()), ...)
7-
XCTAssertEqual(Array(try expression1()), Array(try expression2()), message, file: file, line: line)
8+
try XCTAssertEqual(Array(expression1()), Array(expression2()), message, file: file, line: line)
89
}

0 commit comments

Comments
 (0)
0