diff --git a/veautiful.md b/veautiful.md index 012a32feffbdca3491669e32040456900455d16f..6d3a0c23df2828d65ee3a12384a689ffbe02b535 100644 --- a/veautiful.md +++ b/veautiful.md @@ -216,14 +216,18 @@ trait DiffNode extends DNode with MakeItSo { def updateChildren(to:Seq[VNode]):Unit = { // Use a diff algorithm to work out changes to make to children - val diffOps = Differ.seqDiff(children, to) + val diffReport = Differ.diffs(children, to) // implement changes + Differ.processDiffs(this, diffReport.ops) + children = diffReport.update // Recurse down the DiffNode's (new) children, getting them to "make it so" - updating.zip(to).collect({ case (x:MakeItSo, y:MakeItSo) => - x.makeItSo(y) - }) + children.iterator.zip(to.iterator) foreach { + case (uu:MakeItSo, tt:MakeItSo) => uu.makeItSo(tt) + case (u:Update, _) => u.update() + case _ => // nothing to do + } } ```