mirror of
https://github.com/apple/swift-collections
synced 2026-11-29 05:14:20 +00:00
Sources: Add unsafe keywords where needed
This commit is contained in:
301 files changed
+6051
-5498
No files matched your search
@@ -45,7 +45,7 @@ extension SortedSet: Decodable where Element: Decodable {
|
||||
guard previousElement == nil || previousElement! < element else {
|
||||
let context = DecodingError.Context(
|
||||
codingPath: container.codingPath,
|
||||
debugDescription: "Decoded elements out of order.")
|
||||
debugDescription: "Decoded elements out of order")
|
||||
throw DecodingError.dataCorrupted(context)
|
||||
}
|
||||
builder.append(element)
|
||||
|
||||
@@ -47,7 +47,7 @@ extension SortedSet {
|
||||
var previousElement: Element? = nil
|
||||
for element in elements {
|
||||
precondition(previousElement == nil || previousElement! < element,
|
||||
"Sequence out of order.")
|
||||
"Sequence out of order")
|
||||
builder.append(element)
|
||||
previousElement = element
|
||||
}
|
||||
|
||||
+2
-1
@@ -161,7 +161,8 @@ extension SortedSet {
|
||||
bounds.upperBound._index.ensureValid(forTree: self._root)
|
||||
bounds.lowerBound._index.ensureValid(forTree: self._root)
|
||||
|
||||
return self._root.removeSubrange(Range(uncheckedBounds: (bounds.lowerBound._index, bounds.upperBound._index)))
|
||||
return self._root.removeSubrange(
|
||||
unsafe Range(uncheckedBounds: (bounds.lowerBound._index, bounds.upperBound._index)))
|
||||
}
|
||||
|
||||
/// Removes all elements from the set.
|
||||
|
||||
Reference in new issue
Block a user