summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-11-25 15:01:01 +0200
committerAlon Levy <alon@pobox.com>2014-11-25 15:01:01 +0200
commitee49c39e603a48e93465a389eff2b7b7d2b31f4a (patch)
tree899c01f601377db2c630b9e18ec696154955e594
parent57c8ebdf01fa81fb70177485a61171daef92208b (diff)
graph/findNodeByName: use "or" initialization idiom
-rw-r--r--src/model/graph.js5
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];