aboutsummaryrefslogtreecommitdiffstats
path: root/Types.h
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-02-17 23:19:11 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-02-18 05:33:44 +0800
commitde574487e43b15184ce81e7cb9885fd1387f4964 (patch)
tree4c250148e23bbfeb595f00260b99c9836d08c9eb /Types.h
parent294648b534e294554f5ceb8467667eac3a60a3f1 (diff)
downloaddexon-solidity-de574487e43b15184ce81e7cb9885fd1387f4964.tar.gz
dexon-solidity-de574487e43b15184ce81e7cb9885fd1387f4964.tar.zst
dexon-solidity-de574487e43b15184ce81e7cb9885fd1387f4964.zip
getMemberTypes() respects source order
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Types.h b/Types.h
index b66857f0..d529d8d0 100644
--- a/Types.h
+++ b/Types.h
@@ -50,14 +50,16 @@ using TypePointers = std::vector<TypePointer>;
class MemberList
{
public:
- using MemberMap = std::map<std::string, TypePointer>;
+ using MemberMap = std::vector<std::pair<std::string, TypePointer>>;
MemberList() {}
explicit MemberList(MemberMap const& _members): m_memberTypes(_members) {}
TypePointer getMemberType(std::string const& _name) const
{
- auto it = m_memberTypes.find(_name);
- return it != m_memberTypes.end() ? it->second : TypePointer();
+ for (auto const& it: m_memberTypes)
+ if (it.first == _name)
+ return it.second;
+ return TypePointer();
}
MemberMap::const_iterator begin() const { return m_memberTypes.begin(); }