Skip to content

Commit

Permalink
Cleaned up return values to always be an array
Browse files Browse the repository at this point in the history
  • Loading branch information
rustedgrail committed Feb 2, 2018
1 parent 064d499 commit f529d9a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/position/bk.js
Expand Up @@ -225,12 +225,7 @@ function horizontalCompaction(g, layering, root, align, reverseSep) {
var traversalFuncs = getNextTraversalFuncs(v);

while(traversalFuncs.length) {
// funcsOrX is an array of function calls or the xs value for v. If it's
// the xs value, xs has already been set as part of the function call.
var funcsOrX = traversalFuncs.shift()();
if (funcsOrX instanceof Array) {
traversalFuncs = funcsOrX.concat(traversalFuncs);
}
traversalFuncs = traversalFuncs.shift()().concat(traversalFuncs);
}
}

Expand All @@ -250,7 +245,8 @@ function horizontalCompaction(g, layering, root, align, reverseSep) {
xs[v] = _.reduce(blockG.inEdges(v), function(acc, e) {
return Math.max(acc, xs[e.v] + blockG.edge(e));
}, 0);
return xs[v];

return [];
}]);
}

Expand All @@ -275,7 +271,8 @@ function horizontalCompaction(g, layering, root, align, reverseSep) {
if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {
xs[v] = Math.max(xs[v], min);
}
return xs[v];

return [];
}]);
}

Expand Down

0 comments on commit f529d9a

Please sign in to comment.