Merge pull request #10416 from ethereum/speedUpByMovingAssertion

Superspeed.
This commit is contained in:
chriseth 2020-11-30 11:35:20 +01:00 committed by GitHub
commit 45307a24d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,9 +103,9 @@ void CommonSubexpressionEliminator::visit(Expression& _e)
for (auto const& [variable, value]: m_value)
{
assertThrow(value.value, OptimizerException, "");
assertThrow(inScope(variable), OptimizerException, "");
if (SyntacticallyEqual{}(_e, *value.value))
{
assertThrow(inScope(variable), OptimizerException, "");
_e = Identifier{locationOf(_e), variable};
break;
}