aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/util/SourceFile.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-02-10 12:32:22 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 11:09:43 +0100
commitdf404e51a41020e9385020f6ee123ff07fd4badc (patch)
tree57a7543ab1646c0b6e52ea0250a9531ce7ce8447 /src/dotty/tools/dotc/util/SourceFile.scala
parent0c755d211fcfeb7d19a3fe87d5513e97a3f47da1 (diff)
downloaddotty-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.scala2
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
}