File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -205,10 +205,9 @@ extension BidirectionalCollection where SubSequence == BidirectionalSlice<Self>
205
205
extension BidirectionalCollection where SubSequence == Self {
206
206
/// Removes and returns the last element of the collection.
207
207
///
208
- /// `popLast()` should generally be preferred over `removeLast()`.
209
- ///
210
- /// You should only opt for `removeLast()` if you are certain the collection
211
- /// is not empty and performance is an issue.
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.
212
211
///
213
212
/// - Returns: The last element of the collection if the collection has one
214
213
/// or more elements; otherwise, `nil`.
@@ -224,10 +223,10 @@ extension BidirectionalCollection where SubSequence == Self {
224
223
225
224
/// Removes and returns the last element of the collection.
226
225
///
227
- /// You should only use this if you are certain the collection
228
- /// is not empty and performance is an issue.
229
- ///
230
- /// Otherwise opt for `popLast()`.
226
+ /// The collection must not be empty.
227
+ ///
228
+ /// To remove the last element of a collection that might be empty,
229
+ /// use the `popLast()` method instead .
231
230
///
232
231
/// - Returns: The last element of the collection.
233
232
///
You can’t perform that action at this time.
0 commit comments