Remove redundant check in updateChildren#117
Remove redundant check in updateChildren#117dy wants to merge 1 commit intochoojs:masterfrom dy:patch-1
Conversation
|
Hmm, I think this might be a performance optimization to avoid having to walk through all the children in the common case? Most of the time your tree keeps a similar shape, and an update doesn't move elements around, so it avoids calling |
|
https://github.com/choojs/nanomorph/blob/master/index.js#L127-L132 Not sure initializing a loop is perf hit - condition check looks like the cheapest thing possible. I'd speculate this clause is kept as part of the mindflow, without realizing the generalized case. Also it's a bit easier to understand the way it is now. But there doesn't seem to be any optimization, just a couple |
This check is handled by more generic following condition.