From da3fb9a55b17bc5126df9e2aa2b402300c128215 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Sun, 30 Nov 2025 16:05:26 +0900 Subject: [PATCH] Use String.repeat in scala.io.Source --- library/src/scala/io/Source.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/scala/io/Source.scala b/library/src/scala/io/Source.scala index 35de2a30b06d..b372fc75db9e 100644 --- a/library/src/scala/io/Source.scala +++ b/library/src/scala/io/Source.scala @@ -317,7 +317,7 @@ abstract class Source extends Iterator[Char] with Closeable { report(pos, msg, out) } - private def spaces(n: Int) = List.fill(n)(' ').mkString + private def spaces(n: Int) = " ".repeat(n) /** * @param pos the source position (line/column) * @param msg the error message to report