mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Apply suggestions
This commit is contained in:
parent
1ec239c63f
commit
84d3af4a29
@ -149,7 +149,7 @@ std::set<YulString> Object::qualifiedDataNames() const
|
|||||||
return qualifiedNames;
|
return qualifiedNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::visitPath(YulString _qualifiedName, std::function<bool(Object const*)> _visitor) const
|
void Object::visitPath(YulString _qualifiedName, std::function<bool(Object const*)> const& _visitor) const
|
||||||
{
|
{
|
||||||
yulAssert(!_qualifiedName.empty(), "");
|
yulAssert(!_qualifiedName.empty(), "");
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ std::vector<size_t> Object::pathToSubObject(YulString _qualifiedName) const
|
|||||||
|
|
||||||
this->visitPath(_qualifiedName, [&](Object const* _object) -> bool {
|
this->visitPath(_qualifiedName, [&](Object const* _object) -> bool {
|
||||||
yulAssert(_object->subId != std::numeric_limits<size_t>::max(), "");
|
yulAssert(_object->subId != std::numeric_limits<size_t>::max(), "");
|
||||||
path.push_back({_object->subId});
|
path.push_back(_object->subId);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
return path;
|
return path;
|
||||||
@ -205,12 +205,10 @@ Object const* Object::subObjectAt(std::string const& _qualifiedName)
|
|||||||
|
|
||||||
Object const* foundObject = nullptr;
|
Object const* foundObject = nullptr;
|
||||||
this->visitPath(YulString(_qualifiedName), [&](Object const* _subObject) -> bool {
|
this->visitPath(YulString(_qualifiedName), [&](Object const* _subObject) -> bool {
|
||||||
if (targetObjectName == _subObject->name.str())
|
if (targetObjectName != _subObject->name.str())
|
||||||
{
|
return false;
|
||||||
foundObject = _subObject;
|
foundObject = _subObject;
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return foundObject;
|
return foundObject;
|
||||||
|
@ -127,7 +127,7 @@ public:
|
|||||||
/// it continues until the last subobject in the path is reached.
|
/// it continues until the last subobject in the path is reached.
|
||||||
void visitPath(
|
void visitPath(
|
||||||
YulString _qualifiedName,
|
YulString _qualifiedName,
|
||||||
std::function<bool(Object const*)> _visitor
|
std::function<bool(Object const*)> const& _visitor
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
Object const* at(YulString _name) const;
|
Object const* at(YulString _name) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user