Skip to content

Commit 94f19a6

Browse files
authored
Updated SyntacticConveniences.scala (#129)
toList method was not properly written.
1 parent 7c209f9 commit 94f19a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/scalatutorial/sections/SyntacticConveniences.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ object SyntacticConveniences extends ScalaTutorialSection {
353353
*/
354354
def repeatedParameters(res0: Double): Unit = {
355355
def average(x: Int, xs: Int*): Double =
356-
(x :: xs.to(List)).sum.toDouble / (xs.size + 1)
356+
(x :: xs.toList).sum.toDouble / (xs.size + 1)
357357

358358
average(1) shouldBe 1.0
359359
average(1, 2) shouldBe 1.5

0 commit comments

Comments
 (0)