Exploit tighter lambda syntax

This commit is contained in:
Tony Garnock-Jones 2018-10-22 15:06:01 +01:00
parent 35350dc740
commit 0ba53d37b5
1 changed files with 5 additions and 7 deletions

View File

@ -62,7 +62,7 @@ function projectPath(v, path) {
} }
function projectPaths(v, paths) { function projectPaths(v, paths) {
return paths.map((path) => { return projectPath(v, path) }); return paths.map((path) => projectPath(v, path));
} }
Node.prototype.extend = function(skeleton) { Node.prototype.extend = function(skeleton) {
@ -80,9 +80,8 @@ Node.prototype.extend = function(skeleton) {
let nextNode = table.get(cls, false); let nextNode = table.get(cls, false);
if (!nextNode) { if (!nextNode) {
nextNode = new Node(new Continuation( nextNode = new Node(new Continuation(
node.continuation.cachedAssertions.filter((a) => { node.continuation.cachedAssertions.filter(
return classOf(project(a, path)) === cls; (a) => classOf(project(a, path)) === cls)));
})));
table = table.set(cls, nextNode); table = table.set(cls, nextNode);
node.edges = node.edges.set(selector, table); node.edges = node.edges.set(selector, table);
} }
@ -113,9 +112,8 @@ Index.prototype.addHandler = function(analysisResults, callback) {
} }
let leaf = constValMap.get(constVals, false); let leaf = constValMap.get(constVals, false);
if (!leaf) { if (!leaf) {
leaf = new Leaf(continuation.cachedAssertions.filter((a) => { leaf = new Leaf(continuation.cachedAssertions.filter(
return projectPaths(a, constPaths).equals(constVals); (a) => projectPaths(a, constPaths).equals(constVals)));
}));
constValMap = constValMap.set(constVals, leaf); constValMap = constValMap.set(constVals, leaf);
continuation.leafMap = continuation.leafMap.set(constPaths, constValMap); continuation.leafMap = continuation.leafMap.set(constPaths, constValMap);
} }