Skip to content

Commit 784741b

Browse files
committed
Rely on Collection conformance for .first and .last
There's no need to go through _elements.
1 parent 44fe998 commit 784741b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/SortedArray.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ extension SortedArray {
133133
/// - Complexity: O(1).
134134
@warn_unqualified_access
135135
public func min() -> Element? {
136-
return _elements.first
136+
return first
137137
}
138138

139139
/// Returns the maximum element in the sequence.
140140
///
141141
/// - Complexity: O(1).
142142
@warn_unqualified_access
143143
public func max() -> Element? {
144-
return _elements.last
144+
return last
145145
}
146146
}
147147

0 commit comments

Comments
 (0)