From 1f33039e28b5a5a32ce54800253e0c24e730d333 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 17 May 2016 17:44:14 -0400 Subject: [PATCH] Make matchValue's failureResult non-optional --- js/src/mux.js | 4 ++-- js/src/trie.js | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/js/src/mux.js b/js/src/mux.js index 5058bf1..d9e5b6c 100644 --- a/js/src/mux.js +++ b/js/src/mux.js @@ -100,8 +100,8 @@ function computeAffectedPids(routingTable, delta) { } Mux.prototype.routeMessage = function (body) { - if (Trie.matchValue(this.routingTable, body) === null) { - return Trie.matchValue(this.routingTable, Patch.observe(body)) || Immutable.Set(); + if (Trie.matchValue(this.routingTable, body, null) === null) { + return Trie.matchValue(this.routingTable, Patch.observe(body), null) || Immutable.Set(); } else { // Some other stream has declared body return Immutable.Set(); diff --git a/js/src/trie.js b/js/src/trie.js index 4bd8799..1cec10a 100644 --- a/js/src/trie.js +++ b/js/src/trie.js @@ -405,9 +405,7 @@ function subtract(o1, o2, subtractSuccessesOpt) { // Returns failureResult on failed match, otherwise the appropriate success // value contained in the trie r. -function matchValue(r, v, failureResultOpt) { - var failureResult = failureResultOpt || null; - +function matchValue(r, v, failureResult) { var vs = Immutable.List.of(v); while (!is_emptyTrie(r)) {