1
0

diplomacy: eliminate redundant bindings

This commit is contained in:
Wesley W. Terpstra 2017-11-20 17:20:54 -08:00
parent baa31edf7d
commit 44f99cd9a5

View File

@ -256,7 +256,7 @@ trait BindingScope
eval eval
val map: Map[Device, ResourceBindings] = val map: Map[Device, ResourceBindings] =
resourceBindings.reverse.groupBy(_._1.owner).mapValues(seq => ResourceBindings( resourceBindings.reverse.groupBy(_._1.owner).mapValues(seq => ResourceBindings(
seq.groupBy(_._1.key).mapValues(_.map(z => Binding(z._2, z._3))))) seq.groupBy(_._1.key).mapValues(_.map(z => Binding(z._2, z._3)).distinct)))
val tree = makeTree(map.toList.flatMap { case (d, m) => val tree = makeTree(map.toList.flatMap { case (d, m) =>
val Description(name, mapping) = d.describe(m) val Description(name, mapping) = d.describe(m)
val tokens = name.split("/").toList val tokens = name.split("/").toList