I spent time reading stuff about React diff algorithm recently, and I get to know there are two steps of array-like children diff:
mapRemainingChildren and keep looping the remaing react element , try find usable old fiber.So, here is my question, why not mapping all old fiber at once ? Like why not only use step2 ?
I believe both steps above should share a same time complexity like O(N), to keep React diff average O(N). And step2 could cover cases in step1. So, I think step1 is quite redundant.
Is there any more consideration about this design?