How can I convert immutable.Map to mutable.Map in Scala? -


how can convert immutable.map mutable.map in scala can update values in map?

the cleanest way use mutable.map varargs factory. unlike ++ approach, uses canbuildfrom mechanism, , has potential more efficient if library code written take advantage of this:

val m = collection.immutable.map(1->"one",2->"two") val n = collection.mutable.map(m.toseq: _*)  

this works because map can viewed sequence of pairs.


Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -