Skip to content

Commit 5c4af52

Browse files
committed
Resolves #8.
1 parent d1f5acb commit 5c4af52

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/coconut/diffing/Differ.hx

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class Differ<Real:{}> {
167167
case null:
168168
renderAll(nodes, parent, later);
169169
case v:
170-
v.each(later, function (_) lastCount++);
170+
v.justCount();
171171
updateAll(v, nodes, parent, later);
172172
}
173173

src/coconut/diffing/Rendered.hx

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ class Rendered<Real:{}> {
2121
return found;
2222
}
2323

24+
public function justCount() {
25+
var ret = 0;
26+
for (c in childList) ret += switch c {
27+
case RNative(_, _, _): 1;
28+
case RWidget(w, _): @:privateAccess w._coco_lastRender.justCount();
29+
}
30+
return ret;
31+
}
32+
2433
public function each(later:Later, f:Real->Void) {
2534
function rec(children:Array<RNode<Real>>)
2635
for (c in children) switch c {

0 commit comments

Comments
 (0)