aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/server.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-07-15 21:29:41 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-08-02 21:32:36 +0200
commitfa89ca9b5bd334813fd7e7edb202c56b35076e8d (patch)
treebb160f22ce43ace7f87a76de050e222f13a24758 /src/rpc/server.cpp
parentfa459bdc87bbb050ca1c8d469023a96ed798540e (diff)
refactor: Use C++11 range based for loops to simplify rpc code
Diffstat (limited to 'src/rpc/server.cpp')
-rw-r--r--src/rpc/server.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
index e5f6b1b9f1..9c8e7fe04a 100644
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -256,13 +256,8 @@ static const CRPCCommand vRPCCommands[] =
CRPCTable::CRPCTable()
{
- unsigned int vcidx;
- for (vcidx = 0; vcidx < (sizeof(vRPCCommands) / sizeof(vRPCCommands[0])); vcidx++)
- {
- const CRPCCommand *pcmd;
-
- pcmd = &vRPCCommands[vcidx];
- mapCommands[pcmd->name].push_back(pcmd);
+ for (const auto& c : vRPCCommands) {
+ appendCommand(c.name, &c);
}
}