File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ extension Collection {
286286 /// accesses the `count` of the base collection.
287287 @inlinable
288288 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. " )
290290 return Combinations ( self , k: k)
291291 }
292292}
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ extension Collection {
242242 ///
243243 /// - Complexity: O(1)
244244 public func permutations( ofCount k: Int ? = nil ) -> Permutations < Self > {
245- assert (
245+ precondition (
246246 k ?? 0 >= 0 ,
247247 " Can't have permutations with a negative number of elements. " )
248248 return Permutations ( self , k: k)
You can’t perform that action at this time.
0 commit comments