mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
Replace less then with less then or equal in removeLast(_:) and removeFirst (_BTree)
This commit is contained in:
1 parent
c623860624
commit
258df07928
1 file changed
+2
-2
@@ -58,7 +58,7 @@ extension _BTree {
|
||||
@inlinable
|
||||
@inline(__always)
|
||||
public mutating func removeLast(_ k: Int) {
|
||||
assert(0 <= k && k < self.count, "Can't remove more items from a collection than it contains")
|
||||
assert(0 <= k && k <= self.count, "Can't remove more items from a collection than it contains")
|
||||
for _ in 0..<k {
|
||||
self.removeLast()
|
||||
}
|
||||
@@ -95,7 +95,7 @@ extension _BTree {
|
||||
@inlinable
|
||||
@inline(__always)
|
||||
public mutating func removeFirst(_ k: Int) {
|
||||
assert(0 <= k && k < self.count, "Can't remove more items from a collection than it contains")
|
||||
assert(0 <= k && k <= self.count, "Can't remove more items from a collection than it contains")
|
||||
for _ in 0..<k {
|
||||
self.removeFirst()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user