From 2196c51821e340c9a9d2c76c30f9402370f84994 Mon Sep 17 00:00:00 2001 From: Chun Kuan Lee Date: Wed, 17 Oct 2018 23:12:28 +0800 Subject: refactor: Use boost::scoped_connection in signal/slot, also prefer range-based loop instead of std::transform --- src/rpc/server.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/rpc/server.cpp') diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 60bf3c28c0..19603e7a54 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -500,11 +500,7 @@ UniValue CRPCTable::execute(const JSONRPCRequest &request) const std::vector CRPCTable::listCommands() const { std::vector commandList; - typedef std::map commandMap; - - std::transform( mapCommands.begin(), mapCommands.end(), - std::back_inserter(commandList), - boost::bind(&commandMap::value_type::first,_1) ); + for (const auto& i : mapCommands) commandList.emplace_back(i.first); return commandList; } -- cgit v1.2.3 From cb53b825c26af6e628ba88d72b2000e75bedbbc6 Mon Sep 17 00:00:00 2001 From: Chun Kuan Lee Date: Wed, 17 Oct 2018 23:51:17 +0800 Subject: scripted-diff: Replace boost::bind with std::bind -BEGIN VERIFY SCRIPT- for j in $(seq 1 5) do sed -i "s/ _${j}/ std::placeholders::_${j}/g" $(git grep --name-only " _${j}" -- '*.cpp' '*.h') done sed -i "s/boost::bind/std::bind/g" $(git grep --name-only boost::bind -- '*.cpp' '*.h') sed -i "s/boost::ref/std::ref/g" $(git grep --name-only boost::ref -- '*.cpp' '*.h') sed -i '/boost\/bind/d' $(git grep --name-only boost/bind) -END VERIFY SCRIPT- --- src/rpc/server.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/rpc/server.cpp') diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 19603e7a54..9a0cfebdf5 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -14,7 +14,6 @@ #include #include -#include #include #include #include -- cgit v1.2.3