fixup! getObject -> Object::objectAt

This commit is contained in:
Kamil Śliwak 2023-08-25 16:56:40 +02:00
parent 75d34815bf
commit f34171f806
3 changed files with 5 additions and 5 deletions

View File

@ -193,11 +193,11 @@ vector<size_t> Object::pathToSubObject(YulString _qualifiedName) const
return path;
}
std::shared_ptr<Object> Object::objectAt(std::shared_ptr<Object> const& _object, string const& _qualifiedName)
std::shared_ptr<Object> Object::objectAt(std::shared_ptr<Object> const& _object, YulString _qualifiedName)
{
std::shared_ptr<Object> object = nullptr;
traverseObjectTree(_object.get(), YulString(_qualifiedName), [&](Object const* _obj) -> bool {
if (!_qualifiedName.empty() && _qualifiedName != _obj->name.str())
traverseObjectTree(_object.get(), _qualifiedName, [&](Object const* _obj) -> bool {
if (!_qualifiedName.empty() && _qualifiedName != _obj->name)
return false;
object = make_shared<Object>(*_obj);

View File

@ -142,7 +142,7 @@ public:
/// @returns a shared_ptr to the Object or a nullptr if it was not found.
static std::shared_ptr<Object> objectAt(
std::shared_ptr<Object> const& _object,
std::string const& _qualifiedName
YulString _qualifiedName
);
};

View File

@ -253,7 +253,7 @@ public:
{
if (!m_inputIsCodeBlock)
{
shared_ptr<Object> subObject = Object::objectAt(m_object, _objectPath);
shared_ptr<Object> subObject = Object::objectAt(m_object, YulString(_objectPath));
if (subObject == nullptr)
solThrow(Exception, "Assembly object not found.");