We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df9ae88 commit 4b4f977Copy full SHA for 4b4f977
lib/ASTGen/Sources/ASTGen/Bridge.swift
@@ -32,13 +32,8 @@ extension BridgedSourceLoc {
32
at position: AbsolutePosition,
33
in buffer: UnsafeBufferPointer<UInt8>
34
) {
35
- if let start = buffer.baseAddress,
36
- position.utf8Offset >= 0 && position.utf8Offset < buffer.count {
37
- assert(position.utf8Offset >= 0 && position.utf8Offset < buffer.count)
38
- self = SourceLoc_advanced(BridgedSourceLoc(raw: start), SwiftInt(position.utf8Offset))
39
- } else {
40
- self = nil
41
- }
+ precondition(position.utf8Offset >= 0 && position.utf8Offset < buffer.count)
+ self = SourceLoc_advanced(BridgedSourceLoc(raw: buffer.baseAddress), SwiftInt(position.utf8Offset))
42
}
43
44
0 commit comments