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
|
||||
) const
|
||||
{
|
||||
// Super is not possible 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.
|
||||
if (_searchStart == nullptr && !virtualSemantics())
|
||||
// The modifier is not virtual, we can stop here.
|
||||
if (!virtualSemantics())
|
||||
return *this;
|
||||
|
||||
solAssert(!dynamic_cast<ContractDefinition const&>(*scope()).isLibrary(), "");
|
||||
|
||||
for (ContractDefinition const* c: _mostDerivedContract.annotation().linearizedBaseContracts)
|
||||
{
|
||||
if (_searchStart != nullptr && c != _searchStart)
|
||||
continue;
|
||||
_searchStart = nullptr;
|
||||
for (ModifierDefinition const* modifier: c->functionModifiers())
|
||||
if (modifier->name() == name())
|
||||
return *modifier;
|
||||
}
|
||||
|
||||
solAssert(false, "Virtual modifier " + name() + " not found.");
|
||||
return *this; // not reached
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user