(node, f)
| 26 | } |
| 27 | |
| 28 | function forEachTree (node, f) { |
| 29 | var top |
| 30 | var st = [node] |
| 31 | while (st.length) { |
| 32 | top = st.shift() |
| 33 | if (top.d) { f(top) } |
| 34 | if (top.c) { |
| 35 | for (var c in top.c) { |
| 36 | st.unshift(top.c[c]) |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /* |
| 43 | Increments lock count by 1 for every node in the given ancestry path. |