diff options
| author | Alon Levy <alon@pobox.com> | 2014-11-25 15:01:01 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-11-25 15:01:01 +0200 |
| commit | ee49c39e603a48e93465a389eff2b7b7d2b31f4a (patch) | |
| tree | 899c01f601377db2c630b9e18ec696154955e594 /src/model/graph.js | |
| parent | 57c8ebdf01fa81fb70177485a61171daef92208b (diff) | |
graph/findNodeByName: use "or" initialization idiom
Diffstat (limited to 'src/model/graph.js')
| -rw-r--r-- | src/model/graph.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/model/graph.js b/src/model/graph.js index 967c369c..e2c1b9d1 100644 --- a/src/model/graph.js +++ b/src/model/graph.js @@ -477,10 +477,7 @@ function Graph() { } var findNodeByName = function(name, state) { - if (undefined == state){ - state = null; - } - + state = state || null; for (var i = 0 ; i < nodes.length ; ++i) { if (compareNames(nodes[i].name, name) || nodes[i].state === state) { return nodes[i]; |
