Skip to content

Commit eda2e8a

Browse files
committed
Remove optional
1 parent e29dca3 commit eda2e8a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Tool/Sources/XcodeInspector/SourceEditor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public extension SourceEditor {
202202
var cursorRange = CursorRange(start: .zero, end: .outOfScope)
203203
for (i, line) in lines.enumerated() {
204204
// The range is counted in UTF8, which causes line endings like \r\n to be of length 2.
205-
let lineEndingAddition = (line.lineEnding?.utf8.count ?? 1) - 1
205+
let lineEndingAddition = line.lineEnding.utf8.count - 1
206206
if countS <= range.lowerBound,
207207
range.lowerBound < countS + line.count + lineEndingAddition
208208
{

0 commit comments

Comments
 (0)