File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ extension Collection {
286
286
/// accesses the `count` of the base collection.
287
287
@inlinable
288
288
public func combinations( ofCount k: Int ) -> Combinations < Self > {
289
- assert ( k >= 0 , " Can't have combinations with a negative number of elements. " )
289
+ precondition ( k >= 0 , " Can't have combinations with a negative number of elements. " )
290
290
return Combinations ( self , k: k)
291
291
}
292
292
}
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ extension Collection {
242
242
///
243
243
/// - Complexity: O(1)
244
244
public func permutations( ofCount k: Int ? = nil ) -> Permutations < Self > {
245
- assert (
245
+ precondition (
246
246
k ?? 0 >= 0 ,
247
247
" Can't have permutations with a negative number of elements. " )
248
248
return Permutations ( self , k: k)
You can’t perform that action at this time.
0 commit comments