From cb6cdfe7801a3362a489d0fd39cc0ce5a7075fea Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 25 Sep 2017 09:41:04 +0100 Subject: Simplify switch statements by refactoring internal break statements --- libsolidity/codegen/CompilerUtils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libsolidity/codegen/CompilerUtils.cpp') diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp index 4d273b87..c1171c1d 100644 --- a/libsolidity/codegen/CompilerUtils.cpp +++ b/libsolidity/codegen/CompilerUtils.cpp @@ -596,7 +596,6 @@ void CompilerUtils::convertType( storeInMemoryDynamic(IntegerType(256)); // stack: mempos datapos storeStringData(data); - break; } else solAssert( @@ -820,15 +819,16 @@ void CompilerUtils::convertType( // stack:
m_context << Instruction::POP; - break; } - - // All other types should not be convertible to non-equal types. - solAssert(_typeOnStack == _targetType, "Invalid type conversion requested."); - if (_cleanupNeeded && _targetType.canBeStored() && _targetType.storageBytes() < 32) + else + { + // All other types should not be convertible to non-equal types. + solAssert(_typeOnStack == _targetType, "Invalid type conversion requested."); + if (_cleanupNeeded && _targetType.canBeStored() && _targetType.storageBytes() < 32) m_context << ((u256(1) << (8 * _targetType.storageBytes())) - 1) << Instruction::AND; + } break; } -- cgit v1.2.3