mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +00:00
Sources: Add unsafe keywords where needed
This commit is contained in:
301 files changed
+6051
-5498
No files matched your search
@@ -16,7 +16,7 @@ extension BitArray {
|
||||
///
|
||||
/// - Parameter value: The Boolean value to which to set the array's elements.
|
||||
public mutating func fill(with value: Bool = true) {
|
||||
fill(in: Range(uncheckedBounds: (0, count)), with: value)
|
||||
fill(in: unsafe Range(uncheckedBounds: (0, count)), with: value)
|
||||
}
|
||||
|
||||
/// Set every bit of this array within the specified range to `value`
|
||||
@@ -25,11 +25,11 @@ extension BitArray {
|
||||
/// - Parameter range: The range whose elements to overwrite.
|
||||
/// - Parameter value: The Boolean value to which to set the array's elements.
|
||||
public mutating func fill(in range: Range<Int>, with value: Bool = true) {
|
||||
_update { handle in
|
||||
unsafe _update { handle in
|
||||
if value {
|
||||
handle.fill(in: range)
|
||||
unsafe handle.fill(in: range)
|
||||
} else {
|
||||
handle.clear(in: range)
|
||||
unsafe handle.clear(in: range)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user