diff options
author | Mathias Baumann <marenz@supradigital.org> | 2018-12-11 02:02:39 +0800 |
---|---|---|
committer | Mathias Baumann <marenz@supradigital.org> | 2018-12-11 02:02:39 +0800 |
commit | 2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8 (patch) | |
tree | 690b5cc720bb114ec614b74379b8551a8abf5c17 /libsolidity/codegen | |
parent | 871ea22bb9158e23254406d21673cfbeda2d7138 (diff) | |
download | dexon-solidity-2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8.tar dexon-solidity-2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8.tar.gz dexon-solidity-2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8.tar.bz2 dexon-solidity-2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8.tar.lz dexon-solidity-2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8.tar.xz dexon-solidity-2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8.tar.zst dexon-solidity-2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8.zip |
Replace push_back with emplace_back where it makes sense
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ABIFunctions.cpp | 4 | ||||
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libsolidity/codegen/ABIFunctions.cpp b/libsolidity/codegen/ABIFunctions.cpp index b02623de..5000131c 100644 --- a/libsolidity/codegen/ABIFunctions.cpp +++ b/libsolidity/codegen/ABIFunctions.cpp @@ -141,8 +141,8 @@ string ABIFunctions::tupleDecoder(TypePointers const& _types, bool _fromMemory) vector<string> valueNamesLocal; for (size_t j = 0; j < sizeOnStack; j++) { - valueNamesLocal.push_back("value" + to_string(stackPos)); - valueReturnParams.push_back("value" + to_string(stackPos)); + valueNamesLocal.emplace_back("value" + to_string(stackPos)); + valueReturnParams.emplace_back("value" + to_string(stackPos)); stackPos++; } bool dynamic = decodingTypes[i]->isDynamicallyEncoded(); diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 79c53a1c..67876721 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -721,14 +721,14 @@ bool ContractCompiler::visit(WhileStatement const& _whileStatement) eth::AssemblyItem loopStart = m_context.newTag(); eth::AssemblyItem loopEnd = m_context.newTag(); - m_breakTags.push_back({loopEnd, m_context.stackHeight()}); + m_breakTags.emplace_back(loopEnd, m_context.stackHeight()); m_context << loopStart; if (_whileStatement.isDoWhile()) { eth::AssemblyItem condition = m_context.newTag(); - m_continueTags.push_back({condition, m_context.stackHeight()}); + m_continueTags.emplace_back(condition, m_context.stackHeight()); _whileStatement.body().accept(*this); @@ -739,7 +739,7 @@ bool ContractCompiler::visit(WhileStatement const& _whileStatement) } else { - m_continueTags.push_back({loopStart, m_context.stackHeight()}); + m_continueTags.emplace_back(loopStart, m_context.stackHeight()); compileExpression(_whileStatement.condition()); m_context << Instruction::ISZERO; m_context.appendConditionalJumpTo(loopEnd); @@ -770,8 +770,8 @@ bool ContractCompiler::visit(ForStatement const& _forStatement) if (_forStatement.initializationExpression()) _forStatement.initializationExpression()->accept(*this); - m_breakTags.push_back({loopEnd, m_context.stackHeight()}); - m_continueTags.push_back({loopNext, m_context.stackHeight()}); + m_breakTags.emplace_back(loopEnd, m_context.stackHeight()); + m_continueTags.emplace_back(loopNext, m_context.stackHeight()); m_context << loopStart; // if there is no terminating condition in for, default is to always be true @@ -997,7 +997,7 @@ void ContractCompiler::appendModifierOrFunctionCode() if (codeBlock) { - m_returnTags.push_back({m_context.newTag(), m_context.stackHeight()}); + m_returnTags.emplace_back(m_context.newTag(), m_context.stackHeight()); codeBlock->accept(*this); solAssert(!m_returnTags.empty(), ""); |