Apply modernize-pass-by-value.

This commit is contained in:
Alexander Arlt
2020-04-14 10:32:13 -05:00
parent 79a44b8170
commit aac7a1e434
29 changed files with 243 additions and 212 deletions
+3 -2
View File
@@ -68,6 +68,7 @@
#include <json/json.h>
#include <boost/algorithm/string.hpp>
#include <utility>
using namespace std;
using namespace solidity;
@@ -79,8 +80,8 @@ using solidity::util::toHex;
static int g_compilerStackCounts = 0;
CompilerStack::CompilerStack(ReadCallback::Callback const& _readFile):
m_readFile{_readFile},
CompilerStack::CompilerStack(ReadCallback::Callback _readFile):
m_readFile{std::move(_readFile)},
m_enabledSMTSolvers{smt::SMTSolverChoice::All()},
m_generateIR{false},
m_generateEwasm{false},
+1 -1
View File
@@ -108,7 +108,7 @@ public:
/// Creates a new compiler stack.
/// @param _readFile callback used to read files for import statements. Must return
/// and must not emit exceptions.
explicit CompilerStack(ReadCallback::Callback const& _readFile = ReadCallback::Callback());
explicit CompilerStack(ReadCallback::Callback _readFile = ReadCallback::Callback());
~CompilerStack();
+1 -1
View File
@@ -591,7 +591,7 @@ boost::variant<StandardCompiler::InputsAndSettings, Json::Value> StandardCompile
));
else
{
ret.sources[sourceName] = result.responseOrErrorMessage;
ret.sources[sourceName] = result.responseOrErrorMessage;
found = true;
break;
}
+4 -3
View File
@@ -24,8 +24,9 @@
#include <libsolidity/interface/CompilerStack.h>
#include <optional>
#include <boost/variant.hpp>
#include <optional>
#include <utility>
namespace solidity::frontend
{
@@ -40,8 +41,8 @@ public:
/// Creates a new StandardCompiler.
/// @param _readFile callback used to read files for import statements. Must return
/// and must not emit exceptions.
explicit StandardCompiler(ReadCallback::Callback const& _readFile = ReadCallback::Callback()):
m_readFile(_readFile)
explicit StandardCompiler(ReadCallback::Callback _readFile = ReadCallback::Callback()):
m_readFile(std::move(_readFile))
{
}