Skip to content

Commit

Permalink
Prevent a few cases of pointless instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jul 1, 2013
1 parent 50498ca commit be94599
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/infer.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,12 @@

function maybeTagAsInstantiated(node, scope) {
var score = scope.fnType.instantiateScore;
if (scope.fnType.args.length && score && nodeSmallerThan(node, score * 5)) {
if (!disabledComputing && score && scope.fnType.args.length && nodeSmallerThan(node, score * 5)) {
maybeInstantiate(scope.prev, score / 2);
setFunctionInstantiated(node, scope);
return true;
} else {
scope.fnType.instantiateScore = null;
}
}

Expand Down

0 comments on commit be94599

Please sign in to comment.