From 2f6dc2e773148f63f4e2b9d9b3f9bb7eb092fde8 Mon Sep 17 00:00:00 2001 From: Mathias Baumann Date: Mon, 10 Dec 2018 19:02:39 +0100 Subject: Replace push_back with emplace_back where it makes sense --- libevmasm/Assembly.cpp | 2 +- libevmasm/ControlFlowGraph.cpp | 2 +- libevmasm/SimplificationRules.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libevmasm') diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 29d9846d..2654eae2 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -83,7 +83,7 @@ AssemblyItem const& Assembly::append(AssemblyItem const& _i) { assertThrow(m_deposit >= 0, AssemblyException, "Stack underflow."); m_deposit += _i.deposit(); - m_items.push_back(_i); + m_items.emplace_back(_i); if (m_items.back().location().isEmpty() && !m_currentSourceLocation.isEmpty()) m_items.back().setLocation(m_currentSourceLocation); return back(); diff --git a/libevmasm/ControlFlowGraph.cpp b/libevmasm/ControlFlowGraph.cpp index d62f5436..e82c2903 100644 --- a/libevmasm/ControlFlowGraph.cpp +++ b/libevmasm/ControlFlowGraph.cpp @@ -87,7 +87,7 @@ void ControlFlowGraph::splitBlocks() m_blocks[id].begin = index; } if (item.type() == PushTag) - m_blocks[id].pushedTags.push_back(BlockId(item.data())); + m_blocks[id].pushedTags.emplace_back(item.data()); if (SemanticInformation::altersControlFlow(item)) { m_blocks[id].end = index + 1; diff --git a/libevmasm/SimplificationRules.cpp b/libevmasm/SimplificationRules.cpp index 1dce5f1e..b812cecc 100644 --- a/libevmasm/SimplificationRules.cpp +++ b/libevmasm/SimplificationRules.cpp @@ -209,7 +209,7 @@ ExpressionTemplate::ExpressionTemplate(Pattern const& _pattern, SourceLocation c item = _pattern.toAssemblyItem(_location); } for (auto const& arg: _pattern.arguments()) - arguments.push_back(ExpressionTemplate(arg, _location)); + arguments.emplace_back(arg, _location); } string ExpressionTemplate::toString() const -- cgit