mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove unnecessary checks in modifier resolve function
This commit is contained in:
parent
b28cd00aa0
commit
b95db2db5e
@ -511,23 +511,20 @@ ModifierDefinition const& ModifierDefinition::resolveVirtual(
|
|||||||
ContractDefinition const* _searchStart
|
ContractDefinition const* _searchStart
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
// Super is not possible with modifiers
|
||||||
solAssert(_searchStart == nullptr, "Used super in connection with modifiers.");
|
solAssert(_searchStart == nullptr, "Used super in connection with modifiers.");
|
||||||
|
|
||||||
// If we are not doing super-lookup and the modifier is not virtual, we can stop here.
|
// The modifier is not virtual, we can stop here.
|
||||||
if (_searchStart == nullptr && !virtualSemantics())
|
if (!virtualSemantics())
|
||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
solAssert(!dynamic_cast<ContractDefinition const&>(*scope()).isLibrary(), "");
|
solAssert(!dynamic_cast<ContractDefinition const&>(*scope()).isLibrary(), "");
|
||||||
|
|
||||||
for (ContractDefinition const* c: _mostDerivedContract.annotation().linearizedBaseContracts)
|
for (ContractDefinition const* c: _mostDerivedContract.annotation().linearizedBaseContracts)
|
||||||
{
|
|
||||||
if (_searchStart != nullptr && c != _searchStart)
|
|
||||||
continue;
|
|
||||||
_searchStart = nullptr;
|
|
||||||
for (ModifierDefinition const* modifier: c->functionModifiers())
|
for (ModifierDefinition const* modifier: c->functionModifiers())
|
||||||
if (modifier->name() == name())
|
if (modifier->name() == name())
|
||||||
return *modifier;
|
return *modifier;
|
||||||
}
|
|
||||||
solAssert(false, "Virtual modifier " + name() + " not found.");
|
solAssert(false, "Virtual modifier " + name() + " not found.");
|
||||||
return *this; // not reached
|
return *this; // not reached
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user