(revs, callback)
| 832 | // The return value from the callback will be passed as context to all |
| 833 | // children of that node |
| 834 | function traverseRevTree(revs, callback) { |
| 835 | var toVisit = revs.slice(); |
| 836 | |
| 837 | var node; |
| 838 | while ((node = toVisit.pop())) { |
| 839 | var pos = node.pos; |
| 840 | var tree = node.ids; |
| 841 | var branches = tree[2]; |
| 842 | var newCtx = |
| 843 | callback(branches.length === 0, pos, tree[0], node.ctx, tree[1]); |
| 844 | for (var i = 0, len = branches.length; i < len; i++) { |
| 845 | toVisit.push({pos: pos + 1, ids: branches[i], ctx: newCtx}); |
| 846 | } |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | function sortByPos(a, b) { |
| 851 | return a.pos - b.pos; |
no outgoing calls
no test coverage detected
searching dependent graphs…