Skip to content

Commit

Permalink
Remove a redundant hash lookup.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170086841
  • Loading branch information
concavelenz authored and brad4d committed Sep 27, 2017
1 parent 7ea5061 commit f52432a
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -261,11 +261,12 @@ private void tryRemoveAssignment(NodeTraversal t, Node n, Node exprRoot,
return;
}

if (state.getOut().isLive(liveness.getVarIndex(var.name))) {
int index = liveness.getVarIndex(var.name);
if (state.getOut().isLive(index)) {
return; // Variable not dead.
}

if (state.getIn().isLive(liveness.getVarIndex(var.name))
if (state.getIn().isLive(index)
&& isVariableStillLiveWithinExpression(n, exprRoot, var.name)) {
// The variable is killed here but it is also live before it.
// This is possible if we have say:
Expand Down

0 comments on commit f52432a

Please sign in to comment.