mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Misc small refactors: Use ranges::views::keys and fmt::format()
This commit is contained in:
parent
2f78e9549a
commit
ded9ef17e8
@ -82,6 +82,9 @@
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
|
||||
#include <range/v3/view/concat.hpp>
|
||||
#include <range/v3/view/map.hpp>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <utility>
|
||||
#include <map>
|
||||
@ -710,10 +713,11 @@ bool CompilerStack::compile(State _stopAfter)
|
||||
1834_error,
|
||||
Error::Type::CodeGenerationError,
|
||||
*sourceLocation,
|
||||
"Unimplemented feature error" +
|
||||
((comment && !comment->empty()) ? ": " + *comment : string{}) +
|
||||
" in " +
|
||||
fmt::format(
|
||||
"Unimplemented feature error {} in {}",
|
||||
(comment && !comment->empty()) ? ": " + *comment : "",
|
||||
_unimplementedError.lineInfo()
|
||||
)
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@ -949,10 +953,7 @@ Json::Value CompilerStack::assemblyJSON(string const& _contractName) const
|
||||
|
||||
vector<string> CompilerStack::sourceNames() const
|
||||
{
|
||||
vector<string> names;
|
||||
for (auto const& s: m_sources)
|
||||
names.push_back(s.first);
|
||||
return names;
|
||||
return ranges::to<vector>(m_sources | ranges::views::keys);
|
||||
}
|
||||
|
||||
map<string, unsigned> CompilerStack::sourceIndices() const
|
||||
|
Loading…
Reference in New Issue
Block a user