mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use the move.
This commit is contained in:
parent
a51a8368aa
commit
18efbb52c0
@ -57,22 +57,26 @@ class AssemblyItem
|
|||||||
public:
|
public:
|
||||||
enum class JumpType { Ordinary, IntoFunction, OutOfFunction };
|
enum class JumpType { Ordinary, IntoFunction, OutOfFunction };
|
||||||
|
|
||||||
AssemblyItem(u256 _push, langutil::SourceLocation const& _location = langutil::SourceLocation()):
|
AssemblyItem(u256 _push, langutil::SourceLocation _location = langutil::SourceLocation()):
|
||||||
AssemblyItem(Push, _push, _location) { }
|
AssemblyItem(Push, std::move(_push), std::move(_location)) { }
|
||||||
AssemblyItem(solidity::Instruction _i, langutil::SourceLocation const& _location = langutil::SourceLocation()):
|
AssemblyItem(solidity::Instruction _i, langutil::SourceLocation _location = langutil::SourceLocation()):
|
||||||
m_type(Operation),
|
m_type(Operation),
|
||||||
m_instruction(_i),
|
m_instruction(_i),
|
||||||
m_location(_location)
|
m_location(std::move(_location))
|
||||||
{}
|
{}
|
||||||
AssemblyItem(AssemblyItemType _type, u256 _data = 0, langutil::SourceLocation const& _location = langutil::SourceLocation()):
|
AssemblyItem(AssemblyItemType _type, u256 _data = 0, langutil::SourceLocation _location = langutil::SourceLocation()):
|
||||||
m_type(_type),
|
m_type(_type),
|
||||||
m_location(_location)
|
m_location(std::move(_location))
|
||||||
{
|
{
|
||||||
if (m_type == Operation)
|
if (m_type == Operation)
|
||||||
m_instruction = Instruction(uint8_t(_data));
|
m_instruction = Instruction(uint8_t(_data));
|
||||||
else
|
else
|
||||||
m_data = std::make_shared<u256>(_data);
|
m_data = std::make_shared<u256>(std::move(_data));
|
||||||
}
|
}
|
||||||
|
AssemblyItem(AssemblyItem const&) = default;
|
||||||
|
AssemblyItem(AssemblyItem&&) = default;
|
||||||
|
AssemblyItem& operator=(AssemblyItem const&) = default;
|
||||||
|
AssemblyItem& operator=(AssemblyItem&&) = default;
|
||||||
|
|
||||||
AssemblyItem tag() const { assertThrow(m_type == PushTag || m_type == Tag, Exception, ""); return AssemblyItem(Tag, data()); }
|
AssemblyItem tag() const { assertThrow(m_type == PushTag || m_type == Tag, Exception, ""); return AssemblyItem(Tag, data()); }
|
||||||
AssemblyItem pushTag() const { assertThrow(m_type == PushTag || m_type == Tag, Exception, ""); return AssemblyItem(PushTag, data()); }
|
AssemblyItem pushTag() const { assertThrow(m_type == PushTag || m_type == Tag, Exception, ""); return AssemblyItem(PushTag, data()); }
|
||||||
|
Loading…
Reference in New Issue
Block a user