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

@@ -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
}
@@ -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.