diff options
author | Martin Odersky <odersky@gmail.com> | 2015-02-10 12:32:22 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-03-18 11:09:43 +0100 |
commit | df404e51a41020e9385020f6ee123ff07fd4badc (patch) | |
tree | 57a7543ab1646c0b6e52ea0250a9531ce7ce8447 /src/dotty/tools/dotc/util/SourceFile.scala | |
parent | 0c755d211fcfeb7d19a3fe87d5513e97a3f47da1 (diff) | |
download | dotty-df404e51a41020e9385020f6ee123ff07fd4badc.tar.gz dotty-df404e51a41020e9385020f6ee123ff07fd4badc.tar.bz2 dotty-df404e51a41020e9385020f6ee123ff07fd4badc.zip |
Make bestFit work for partially filled arrays
Diffstat (limited to 'src/dotty/tools/dotc/util/SourceFile.scala')
-rw-r--r-- | src/dotty/tools/dotc/util/SourceFile.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/util/SourceFile.scala b/src/dotty/tools/dotc/util/SourceFile.scala index c5d88d7bf..45119a881 100644 --- a/src/dotty/tools/dotc/util/SourceFile.scala +++ b/src/dotty/tools/dotc/util/SourceFile.scala @@ -99,7 +99,7 @@ case class SourceFile(file: AbstractFile, content: Array[Char]) { * Lines are numbered from 0 */ def offsetToLine(offset: Int): Int = { - lastLine = Util.bestFit(lineIndices, offset, lastLine) + lastLine = Util.bestFit(lineIndices, lineIndices.length, offset, lastLine) lastLine } |