correct order for IO.readLines

This commit is contained in:
Mark Harrah 2010-09-08 14:29:38 -04:00
parent b03b56ea2e
commit bef61ab9fd
1 changed files with 1 additions and 1 deletions

View File

@ -454,7 +454,7 @@ object IO
// Not optimized for large files
def readLines(in: BufferedReader): List[String] =
foldLines[List[String]](in, Nil)( (accum, line) => line :: accum )
foldLines[List[String]](in, Nil)( (accum, line) => line :: accum ).reverse
def foreachLine(in: BufferedReader)(f: String => Unit): Unit =
foldLines(in, ())( (_, line) => f(line) )