diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-08 00:44:51 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-08-08 00:51:53 +0800 |
commit | b11e39e25ee14b2d56db86ea48e3229a7a6cad52 (patch) | |
tree | f818c974e2cfaf35a1667573837e50bd6f312022 /libsolidity/ast | |
parent | d7756322c07634fa2ca0649a33585fc167079786 (diff) | |
download | dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.gz dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.bz2 dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.lz dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.xz dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.tar.zst dexon-solidity-b11e39e25ee14b2d56db86ea48e3229a7a6cad52.zip |
Remove remaining instances of ``fillRight`` left over from tuple wildcards assignments.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/Types.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 3eccc6d4..2b5f2187 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -2293,16 +2293,14 @@ TypePointer TupleType::closestTemporaryType(TypePointer const& _targetType) cons { solAssert(!!_targetType, ""); TypePointers const& targetComponents = dynamic_cast<TupleType const&>(*_targetType).components(); - bool fillRight = !targetComponents.empty() && (!targetComponents.back() || targetComponents.front()); + solAssert(components().size() == targetComponents.size(), ""); TypePointers tempComponents(targetComponents.size()); - for (size_t i = 0; i < min(targetComponents.size(), components().size()); ++i) + for (size_t i = 0; i < targetComponents.size(); ++i) { - size_t si = fillRight ? i : components().size() - i - 1; - size_t ti = fillRight ? i : targetComponents.size() - i - 1; - if (components()[si] && targetComponents[ti]) + if (components()[i] && targetComponents[i]) { - tempComponents[ti] = components()[si]->closestTemporaryType(targetComponents[ti]); - solAssert(tempComponents[ti], ""); + tempComponents[i] = components()[i]->closestTemporaryType(targetComponents[i]); + solAssert(tempComponents[i], ""); } } return make_shared<TupleType>(tempComponents); |