From 5c0c3c39c218ad4cd16914cd67c41fcd3d42b577 Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Wed, 5 Oct 2016 17:45:24 +0200 Subject: [PATCH] Let the optimizer optimize Following a comment https://github.com/ethereum/solidity/pull/1091#discussion_r81823106 --- libsolidity/codegen/ExpressionCompiler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 9fb8cb08a940..ff6e5bbffe73 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -1341,8 +1341,7 @@ void ExpressionCompiler::appendArithmeticOperatorCode(Token::Value _operator, Ty if (c_isSigned && _operator == Token::Div) { m_context << Instruction::DUP1 // x - << u256(255) << u256(2) << Instruction::EXP // 2 ** 255 - << Instruction::EQ; + << (u256(1) << 255) << Instruction::EQ; // y, x, (x == 2 ** 255) m_context << Instruction::DUP3 << Instruction::NOT //y << Instruction::ISZERO;