mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
Change the expression of preconditions
This commit is contained in:
1 parent
dec05b96fe
commit
43e880b49c
1 file changed
+2
-2
@@ -204,7 +204,7 @@ extension Heap {
|
||||
/// - Complexity: O(log `count`)
|
||||
@inlinable @discardableResult
|
||||
public mutating func replaceMin(with replacement: Element) -> Element {
|
||||
guard !isEmpty else { preconditionFailure("No element to replace") }
|
||||
precondition(!isEmpty, "No element to replace")
|
||||
|
||||
var removed = replacement
|
||||
_update { handle in
|
||||
@@ -233,7 +233,7 @@ extension Heap {
|
||||
/// - Complexity: O(log `count`)
|
||||
@inlinable @discardableResult
|
||||
public mutating func replaceMax(with replacement: Element) -> Element {
|
||||
guard !isEmpty else { preconditionFailure("No element to replace") }
|
||||
precondition(!isEmpty, "No element to replace")
|
||||
|
||||
var removed = replacement
|
||||
_update { handle in
|
||||
|
||||
Reference in new issue
Block a user