mirror of
https://github.com/apple/swift-collections
synced 2026-11-26 04:47:48 +00:00
Sources: Add unsafe keywords where needed
This commit is contained in:
301 files changed
+6051
-5498
No files matched your search
@@ -176,14 +176,14 @@ extension BitArray: RandomAccessCollection, MutableCollection {
|
||||
public subscript(position: Int) -> Bool {
|
||||
get {
|
||||
precondition(position >= 0 && position < _count, "Index out of bounds")
|
||||
return _read { handle in
|
||||
handle[position]
|
||||
return unsafe _read { handle in
|
||||
unsafe handle[position]
|
||||
}
|
||||
}
|
||||
set {
|
||||
precondition(position >= 0 && position < _count, "Index out of bounds")
|
||||
return _update { handle in
|
||||
handle[position] = newValue
|
||||
return unsafe _update { handle in
|
||||
unsafe handle[position] = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user