File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,10 @@ extension BidirectionalCollection where SubSequence == BidirectionalSlice<Self>
204
204
205
205
extension BidirectionalCollection where SubSequence == Self {
206
206
/// Removes and returns the last element of the collection.
207
+ ///
208
+ /// Use `popLast()` to remove the last element of a collection that might be empty.
209
+ ///
210
+ /// The `removeLast()` method must be used only on a nonempty collection.
207
211
///
208
212
/// - Returns: The last element of the collection if the collection has one
209
213
/// or more elements; otherwise, `nil`.
@@ -221,6 +225,9 @@ extension BidirectionalCollection where SubSequence == Self {
221
225
///
222
226
/// The collection must not be empty.
223
227
///
228
+ /// To remove the last element of a collection that might be empty,
229
+ /// use the `popLast()` method instead.
230
+ ///
224
231
/// - Returns: The last element of the collection.
225
232
///
226
233
/// - Complexity: O(1)
You can’t perform that action at this time.
0 commit comments