We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Obtaining 'values' from range view of TreeMap returns all values from original map.
val tm: mutable.TreeMap[String, String] = mutable.TreeMap[String, String]() tm.put("a", "a") tm.put("b", "b") tm.put("c", "c") tm.put("d", "d") println(s"scala: ${tm.range("b", "c").values.mkString(",")}") val jtm = new util.TreeMap[String, String]() jtm.put("a", "a") jtm.put("b", "b") jtm.put("c", "c") jtm.put("d", "d") println(s"java: ${ jtm.subMap("b", "c") .values() .stream() .collect(Collectors.joining(",")) }")
Output: scala: a,b,c,d java: b
Also keySet for mutable.TreeSet works properly on range but for mutable.TreeMap - does not
val tm: mutable.TreeMap[String, String] = mutable.TreeMap[String, String]() tm.put("a", "a") tm.put("b", "b") tm.put("c", "c") tm.put("d", "d") println(s"treeMap: ${tm.range("b", "c").keySet.mkString(",")}") val ts: mutable.TreeSet[String] = mutable.TreeSet[String]() ts.add("a") ts.add("b") ts.add("c") ts.add("d") println(s"treeSet: ${ts.range("b", "c").keySet.mkString(",")}")
Output: treeMap: a,b,c,d treeSet: b
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-10113?orig=1 Reporter: @ichaki5748 Affected Versions: 2.12.1
Sorry, something went wrong.
@ichaki5748 said: Hi Seth,
Please kindly take a look: scala/scala#5637
Thanks
@ichaki5748 said: @seth, could you please kindly advise if I need to do something else so this JIRA is reviewed or I should just wait?
@SethTisue said: well, we're often a bit slow, but we don't mind being prodded a bit, either :-)
I commented on the PR
Dave Nutkins (DaveNutkins) said: This also fixes this problem:
import scala_collection._ val map = mutable.TreeMap(3 -> 4, 4 -> 5, 5 -> 6) map.to(4)
returning an empty TreeMap instead of TreeMap(3 -> 4, 4 -> 5)
ichaki5748
No branches or pull requests
Obtaining 'values' from range view of TreeMap returns all values from original map.
Output:
scala: a,b,c,d
java: b
Also keySet for mutable.TreeSet works properly on range but for mutable.TreeMap - does not
Output:
treeMap: a,b,c,d
treeSet: b
The text was updated successfully, but these errors were encountered: