aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-03-17 01:06:34 +0800
committerchriseth <c@ethdev.com>2015-03-17 01:09:56 +0800
commit9b2a255c1b0ac1e247a59e4cd8cb3c94b53aca7c (patch)
tree0579d4f440f08c6c2e3843d184a98e698dc03b9e /Types.cpp
parent02595abf6ac1c30c7c0125c5a705cd2c85974838 (diff)
downloaddexon-solidity-9b2a255c1b0ac1e247a59e4cd8cb3c94b53aca7c.tar.gz
dexon-solidity-9b2a255c1b0ac1e247a59e4cd8cb3c94b53aca7c.tar.zst
dexon-solidity-9b2a255c1b0ac1e247a59e4cd8cb3c94b53aca7c.zip
Move memberlist to avoid unique_ptr copy.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/Types.cpp b/Types.cpp
index 147eff1e..72f13a01 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -1246,23 +1246,29 @@ MagicType::MagicType(MagicType::Kind _kind):
switch (m_kind)
{
case Kind::Block:
- m_members = MemberList({{"coinbase", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
- {"timestamp", make_shared<IntegerType>(256)},
- {"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Location::BlockHash)},
- {"difficulty", make_shared<IntegerType>(256)},
- {"number", make_shared<IntegerType>(256)},
- {"gaslimit", make_shared<IntegerType>(256)}});
+ m_members = move(MemberList({
+ {"coinbase", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
+ {"timestamp", make_shared<IntegerType>(256)},
+ {"blockhash", make_shared<FunctionType>(strings{"uint"}, strings{"bytes32"}, FunctionType::Location::BlockHash)},
+ {"difficulty", make_shared<IntegerType>(256)},
+ {"number", make_shared<IntegerType>(256)},
+ {"gaslimit", make_shared<IntegerType>(256)}
+ }));
break;
case Kind::Message:
- m_members = MemberList({{"sender", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
- {"gas", make_shared<IntegerType>(256)},
- {"value", make_shared<IntegerType>(256)},
- {"data", make_shared<ArrayType>(ArrayType::Location::CallData)},
- {"sig", make_shared<FixedBytesType>(4)}});
+ m_members = move(MemberList({
+ {"sender", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
+ {"gas", make_shared<IntegerType>(256)},
+ {"value", make_shared<IntegerType>(256)},
+ {"data", make_shared<ArrayType>(ArrayType::Location::CallData)},
+ {"sig", make_shared<FixedBytesType>(4)}
+ }));
break;
case Kind::Transaction:
- m_members = MemberList({{"origin", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
- {"gasprice", make_shared<IntegerType>(256)}});
+ m_members = move(MemberList({
+ {"origin", make_shared<IntegerType>(0, IntegerType::Modifier::Address)},
+ {"gasprice", make_shared<IntegerType>(256)}
+ }));
break;
default:
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown kind of magic."));