Skip to content

Commit a3d59b3

Browse files
committed
[ASTGen]: fix force-unwrap for buffer.baseAddress
1 parent 2aac5d9 commit a3d59b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ASTGen/Sources/ASTGen/Bridge.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ extension BridgedSourceLoc {
3030
/// Form a source location at the given absolute position in `buffer`.
3131
init(
3232
at position: AbsolutePosition,
33-
in buffer: UnsafeBufferPointer<UInt8>?
33+
in buffer: UnsafeBufferPointer<UInt8>
3434
) {
35-
precondition(position.utf8Offset >= 0 && position.utf8Offset < buffer!.count)
36-
self = SourceLoc_advanced(BridgedSourceLoc(raw: buffer!.baseAddress), SwiftInt(position.utf8Offset))
35+
precondition(position.utf8Offset >= 0 && position.utf8Offset < buffer.count)
36+
self = SourceLoc_advanced(BridgedSourceLoc(raw: buffer.baseAddress!), SwiftInt(position.utf8Offset))
3737
}
3838
}
3939

0 commit comments

Comments
 (0)