From e57c137558f65da5efdf129bf7fbd260aef980a7 Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Tue, 16 Aug 2022 17:44:52 +0200 Subject: [PATCH] Minors. --- libevmasm/Assembly.cpp | 4 ++-- libevmasm/Assembly.h | 10 +++++----- libsolidity/interface/CompilerStack.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 7910919e1..9d75d0223 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -79,7 +79,7 @@ void Assembly::addAssemblyItemsFromJSON(Json::Value const& _code) solAssert(m_items.empty(), ""); solAssert(_code.isArray(), ""); for (auto const& jsonItem: _code) - m_items.emplace_back(loadItemFromJSON(jsonItem)); + m_items.emplace_back(createAssemblyItemFromJSON(jsonItem)); for (auto current = m_items.begin(); current != m_items.end(); ++current) { @@ -96,7 +96,7 @@ void Assembly::addAssemblyItemsFromJSON(Json::Value const& _code) } } -AssemblyItem Assembly::loadItemFromJSON(Json::Value const& _json) +AssemblyItem Assembly::createAssemblyItemFromJSON(Json::Value const& _json) { std::string name = _json["name"].isString() ? _json["name"].asString() : ""; int begin = _json["begin"].isInt() ? _json["begin"].asInt() : -1; diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h index 106da2fe3..fd42b7be8 100644 --- a/libevmasm/Assembly.h +++ b/libevmasm/Assembly.h @@ -168,20 +168,20 @@ public: bool isCreation() const { return m_creation; } - /// Set the source list. + /// Set the source name list. void setSources(std::vector> _sources) { m_sources = std::move(_sources); } - /// Set the source list from simple vector. + /// Set the source name list from simple vector. void setSources(std::vector const& _sources) { for (auto const& item: _sources) m_sources.emplace_back(std::make_shared(item)); } - /// @returns List of sources. + /// @returns List of source names. std::vector> sources() const& { return m_sources; } protected: @@ -197,8 +197,8 @@ protected: /// Creates an AssemblyItem from a given JSON representation. /// @param _json JSON representation of an assembly item - /// @returns AssemblyItem from a given JSON representation. - AssemblyItem loadItemFromJSON(Json::Value const& _json); + /// @returns AssemblyItem of _json argument. + AssemblyItem createAssemblyItemFromJSON(Json::Value const& _json); private: bool m_invalid = false; diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 1632c755f..d05561c45 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -423,7 +423,7 @@ void CompilerStack::importEvmAssemblyJson(std::map con if (m_stackState != Empty) solThrow(CompilerError, "Must call importEvmAssemblyJson only before the SourcesSet state."); - Json::Value const& jsonValue = _sources.begin()->second; + Json::Value jsonValue = _sources.begin()->second; if (jsonValue.isMember("sourceList")) for (auto const& item: jsonValue["sourceList"]) { @@ -432,7 +432,7 @@ void CompilerStack::importEvmAssemblyJson(std::map con m_sources.emplace(std::make_pair(item.asString(), source)); m_sourceOrder.push_back(&m_sources[item.asString()]); } - m_evmAssemblyJson[_sources.begin()->first] = jsonValue; + m_evmAssemblyJson[_sources.begin()->first] = std::move(jsonValue); m_importedSources = true; m_stackState = SourcesSet; }