Skip to content

Commit f1a2f22

Browse files
committed
Improved documentation for removeLast()
1 parent cdbfc4f commit f1a2f22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/public/core/BidirectionalCollection.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ extension BidirectionalCollection where SubSequence == Self {
225225

226226
/// Removes and returns the last element of the collection.
227227
///
228-
/// The collection must not be empty.
228+
/// You should only use this if you are certain the collection
229+
/// is not empty and performance is an issue.
230+
///
231+
/// Otherwise opt for popLast() since it is safer.
229232
///
230233
/// - Returns: The last element of the collection.
231234
///

0 commit comments

Comments
 (0)