Sources: Add unsafe keywords where needed

This commit is contained in:
Karoy Lorentey committed 2026-10-01 11:14:29 -07:00
1 parent 13f71ad927
commit d07dc32dfa
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)
}
}
}