Skip to content

Commit dac850d

Browse files
committed
walkable.BFS的bug修复
1 parent 9ff08d1 commit dac850d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/component/Tree.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,10 @@ var walkable = {
3131
}));
3232

3333
if (children.length) {
34-
var initialValue = {};
35-
initialValue[walkable.childrenName] = [];
3634
var grandChildren = children.reduce(function (a, b) {
37-
var subAChildren = a[walkable.childrenName];
3835
var subBChildren = b[walkable.childrenName];
39-
return subAChildren.concat(subBChildren);
40-
}, initialValue);
36+
return a.concat(subBChildren);
37+
}, []);
4138

4239
if (grandChildren.length) {
4340
iterate(grandChildren);

0 commit comments

Comments
 (0)