tidy: modernize-use-emplace

This commit is contained in:
MarcoFalke
2023-10-04 13:53:40 +02:00
parent 4a5aae9330
commit fa05a726c2
47 changed files with 167 additions and 162 deletions

View File

@@ -169,7 +169,7 @@ public:
bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strResult, const std::string &strCommand, const bool fExecute, std::string * const pstrFilteredOut, const WalletModel* wallet_model)
{
std::vector< std::vector<std::string> > stack;
stack.push_back(std::vector<std::string>());
stack.emplace_back();
enum CmdParseState
{
@@ -197,7 +197,7 @@ bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strRes
}
// Make sure stack is not empty before adding something
if (stack.empty()) {
stack.push_back(std::vector<std::string>());
stack.emplace_back();
}
stack.back().push_back(strArg);
};
@@ -206,7 +206,7 @@ bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strRes
if (nDepthInsideSensitive) {
if (!--nDepthInsideSensitive) {
assert(filter_begin_pos);
filter_ranges.push_back(std::make_pair(filter_begin_pos, chpos));
filter_ranges.emplace_back(filter_begin_pos, chpos);
filter_begin_pos = 0;
}
}
@@ -306,7 +306,7 @@ bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strRes
if (nDepthInsideSensitive) {
++nDepthInsideSensitive;
}
stack.push_back(std::vector<std::string>());
stack.emplace_back();
}
// don't allow commands after executed commands on baselevel