Simplification of typeSupportedByOldABIEncoder

This commit is contained in:
Khan M Rashedun-Naby 2018-06-15 00:19:36 +06:00
parent dc5cd3e1e7
commit a5f0caa178

View File

@ -41,15 +41,13 @@ bool typeSupportedByOldABIEncoder(Type const& _type)
{ {
if (_type.dataStoredIn(DataLocation::Storage)) if (_type.dataStoredIn(DataLocation::Storage))
return true; return true;
else if (_type.category() == Type::Category::Struct) if (_type.category() == Type::Category::Struct)
return false; return false;
else if (_type.category() == Type::Category::Array) if (_type.category() == Type::Category::Array)
{ {
auto const& arrayType = dynamic_cast<ArrayType const&>(_type); auto const& arrayType = dynamic_cast<ArrayType const&>(_type);
auto base = arrayType.baseType(); auto base = arrayType.baseType();
if (!typeSupportedByOldABIEncoder(*base)) if (!typeSupportedByOldABIEncoder(*base) || (base->category() == Type::Category::Array && base->isDynamicallySized()))
return false;
else if (base->category() == Type::Category::Array && base->isDynamicallySized())
return false; return false;
} }
return true; return true;