From 0e4bce98931a9a0e4d3ab5c75b5a28905207f444 Mon Sep 17 00:00:00 2001 From: Liam Bohl Date: Thu, 24 Jun 2021 11:37:33 -0400 Subject: [PATCH] Replaced functions deprecated as of 2.13 += (varargs) -> ++= -= (varargs) -> --= retain -> filterInPlace --- _overviews/scala-book/collections-maps.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_overviews/scala-book/collections-maps.md b/_overviews/scala-book/collections-maps.md index 1556a66ef8..95e890bbc3 100644 --- a/_overviews/scala-book/collections-maps.md +++ b/_overviews/scala-book/collections-maps.md @@ -83,18 +83,18 @@ Here are some things you can do with a mutable `Map`: ```scala // add elements with += states += ("AZ" -> "Arizona") -states += ("CO" -> "Colorado", "KY" -> "Kentucky") +states ++= Map("CO" -> "Colorado", "KY" -> "Kentucky") // remove elements with -= states -= "KY" -states -= ("AZ", "CO") +states --= List("AZ", "CO") // update elements by reassigning them states("AK") = "Alaska, The Big State" -// retain elements by supplying a function that operates on +// filter elements by supplying a function that operates on // the keys and/or values -states.retain((k,v) => k == "AK") +states.filterInPlace((k,v) => k == "AK") ```