From 2a50e869d060bd42faae9003fa563398ba8b79c1 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 26 May 2017 20:43:28 +0100 Subject: Move builtin type list to the top --- libsolidity/inlineasm/AsmAnalysis.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 24eddf05..eeb7d0a6 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -38,6 +38,12 @@ using namespace dev; using namespace dev::solidity; using namespace dev::solidity::assembly; +namespace { + +set const builtinTypes{"bool", "u8", "s8", "u32", "s32", "u64", "s64", "u128", "s128", "u256", "s256"}; + +} + bool AsmAnalyzer::analyze(Block const& _block) { if (!(ScopeFiller(m_info.scopes, m_errors))(_block)) @@ -460,7 +466,7 @@ void AsmAnalyzer::expectValidType(string const& type, SourceLocation const& _loc if (!m_julia) return; - if (!(set{"bool", "u8", "s8", "u32", "s32", "u64", "s64", "u128", "s128", "u256", "s256"}).count(type)) + if (!builtinTypes.count(type)) m_errors.push_back(make_shared( Error::Type::TypeError, "\"" + type + "\" is not a valid type (user defined types are not yet supported).", -- cgit v1.2.3