@@ -221,7 +221,9 @@ extension MutableCollection {
221
221
/// After partitioning a collection, there is a pivot index `p` where
222
222
/// no element before `p` satisfies the `belongsInSecondPartition`
223
223
/// predicate and every element at or after `p` satisfies
224
- /// `belongsInSecondPartition`.
224
+ /// `belongsInSecondPartition`. This operation isn't guaranteed to be
225
+ /// stable, so the relative ordering of elements within the partitions might
226
+ /// change.
225
227
///
226
228
/// In the following example, an array of numbers is partitioned by a
227
229
/// predicate that matches elements greater than 30.
@@ -241,6 +243,10 @@ extension MutableCollection {
241
243
/// let second = numbers[p...]
242
244
/// // second == [60, 40]
243
245
///
246
+ /// Note that the order of elements in both partitions changed.
247
+ /// That is, `40` appears before `60` in the original collection,
248
+ /// but, after calling `partition(by:)`, `60` appears before `40`.
249
+ ///
244
250
/// - Parameter belongsInSecondPartition: A predicate used to partition
245
251
/// the collection. All elements satisfying this predicate are ordered
246
252
/// after all elements not satisfying it.
@@ -285,7 +291,9 @@ extension MutableCollection where Self: BidirectionalCollection {
285
291
/// After partitioning a collection, there is a pivot index `p` where
286
292
/// no element before `p` satisfies the `belongsInSecondPartition`
287
293
/// predicate and every element at or after `p` satisfies
288
- /// `belongsInSecondPartition`.
294
+ /// `belongsInSecondPartition`. This operation isn't guaranteed to be
295
+ /// stable, so the relative ordering of elements within the partitions might
296
+ /// change.
289
297
///
290
298
/// In the following example, an array of numbers is partitioned by a
291
299
/// predicate that matches elements greater than 30.
@@ -305,6 +313,10 @@ extension MutableCollection where Self: BidirectionalCollection {
305
313
/// let second = numbers[p...]
306
314
/// // second == [60, 40]
307
315
///
316
+ /// Note that the order of elements in both partitions changed.
317
+ /// That is, `40` appears before `60` in the original collection,
318
+ /// but, after calling `partition(by:)`, `60` appears before `40`.
319
+ ///
308
320
/// - Parameter belongsInSecondPartition: A predicate used to partition
309
321
/// the collection. All elements satisfying this predicate are ordered
310
322
/// after all elements not satisfying it.
0 commit comments