From f34171f8063d1939fd73b525ac5d76267f28b2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Fri, 25 Aug 2023 16:56:40 +0200 Subject: [PATCH] fixup! getObject -> Object::objectAt --- libyul/Object.cpp | 6 +++--- libyul/Object.h | 2 +- test/tools/yulopti.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libyul/Object.cpp b/libyul/Object.cpp index 6c79d4367..83ab83db8 100644 --- a/libyul/Object.cpp +++ b/libyul/Object.cpp @@ -193,11 +193,11 @@ vector Object::pathToSubObject(YulString _qualifiedName) const return path; } -std::shared_ptr Object::objectAt(std::shared_ptr const& _object, string const& _qualifiedName) +std::shared_ptr Object::objectAt(std::shared_ptr const& _object, YulString _qualifiedName) { std::shared_ptr 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(*_obj); diff --git a/libyul/Object.h b/libyul/Object.h index 131b2b5d5..6a46f904a 100644 --- a/libyul/Object.h +++ b/libyul/Object.h @@ -142,7 +142,7 @@ public: /// @returns a shared_ptr to the Object or a nullptr if it was not found. static std::shared_ptr objectAt( std::shared_ptr const& _object, - std::string const& _qualifiedName + YulString _qualifiedName ); }; diff --git a/test/tools/yulopti.cpp b/test/tools/yulopti.cpp index f4be2f53b..820779e92 100644 --- a/test/tools/yulopti.cpp +++ b/test/tools/yulopti.cpp @@ -253,7 +253,7 @@ public: { if (!m_inputIsCodeBlock) { - shared_ptr subObject = Object::objectAt(m_object, _objectPath); + shared_ptr subObject = Object::objectAt(m_object, YulString(_objectPath)); if (subObject == nullptr) solThrow(Exception, "Assembly object not found.");