Skip to content

Commit

Permalink
Merge pull request #230 from tylerlong/master
Browse files Browse the repository at this point in the history
`_.minBy` should be `_.min`
  • Loading branch information
cpettitt committed Feb 12, 2018
2 parents 3d538f0 + aa4584e commit 7e050f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rank/util.js
Expand Up @@ -38,7 +38,7 @@ function longestPath(g) {
}
visited[v] = true;

var rank = _.minBy(_.map(g.outEdges(v), function(e) {
var rank = _.min(_.map(g.outEdges(v), function(e) {
return dfs(e.w) - g.edge(e).minlen;
}));

Expand Down
4 changes: 2 additions & 2 deletions lib/util.js
Expand Up @@ -147,7 +147,7 @@ function buildLayerMatrix(g) {
* rank(v) >= 0 and at least one node w has rank(w) = 0.
*/
function normalizeRanks(g) {
var min = _.minBy(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
_.forEach(g.nodes(), function(v) {
var node = g.node(v);
if (_.has(node, "rank")) {
Expand All @@ -158,7 +158,7 @@ function normalizeRanks(g) {

function removeEmptyRanks(g) {
// Ranks may not start at 0, so we need to offset them
var offset = _.minBy(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));

var layers = [];
_.forEach(g.nodes(), function(v) {
Expand Down

0 comments on commit 7e050f8

Please sign in to comment.