Skip to content

Commit

Permalink
fixed files form Closure #115
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent fa2d0af commit a73cce0
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -694,14 +694,6 @@ private CanInlineResult canInlineReferenceDirectly(

Node block = fnNode.getLastChild();

boolean hasSideEffects = false;
if (block.hasChildren()) {
Preconditions.checkState(block.hasOneChild());
Node stmt = block.getFirstChild();
if (stmt.isReturn()) {
hasSideEffects = NodeUtil.mayHaveSideEffects(stmt.getFirstChild(), compiler);
}
}
// CALL NODE: [ NAME, ARG1, ARG2, ... ]
Node cArg = callNode.getFirstChild().getNext();

Expand All @@ -727,9 +719,6 @@ private CanInlineResult canInlineReferenceDirectly(
// For each named parameter check if a mutable argument use more than one.
if (fnParam != null) {
if (cArg != null) {
if (hasSideEffects && NodeUtil.canBeSideEffected(cArg)) {
return CanInlineResult.NO;
}
// Check for arguments that are evaluated more than once.
// Note: Unlike block inlining, there it is not possible that a
// parameter reference will be in a loop.
Expand Down

0 comments on commit a73cce0

Please sign in to comment.