Skip to content

Commit e8ddb36

Browse files
committed
try without checks
1 parent 99574e2 commit e8ddb36

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/src/dotty/tools/dotc/util/SourcePosition.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ extends interfaces.SourcePosition with Showable {
4242
def beforeAndAfterPoint: (List[Int], List[Int]) =
4343
lineOffsets.partition(_ <= point)
4444

45-
def column: Int = if (source.content().length != 0) source.column(point) else -1
45+
def column: Int = source.column(point)
4646

4747
def start: Int = span.start
48-
def startLine: Int = if (source.content().length != 0) source.offsetToLine(start) else -1
49-
def startColumn: Int = if (source.content().length != 0) source.column(start) else -1
48+
def startLine: Int = source.offsetToLine(start)
49+
def startColumn: Int = source.column(start)
5050
def startColumnPadding: String = source.startColumnPadding(start)
5151

5252
def end: Int = span.end
53-
def endLine: Int = if (source.content().length != 0) source.offsetToLine(end) else -1
54-
def endColumn: Int = if (source.content().length != 0) source.column(end) else -1
53+
def endLine: Int = source.offsetToLine(end)
54+
def endColumn: Int = source.column(end)
5555

5656
def withOuter(outer: SourcePosition): SourcePosition = SourcePosition(source, span, outer)
5757
def withSpan(range: Span) = SourcePosition(source, range, outer)

0 commit comments

Comments
 (0)