diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-01-12 06:27:29 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-01-28 08:16:31 +0100 |
commit | faf835680be39811827504f77005b6603165f53e (patch) | |
tree | fda24b841d7b260c553a9586363296274a1fac78 /src/rpc | |
parent | 9deba2de764f0043061d68cc3b984b9df67cf23b (diff) |
rpc: [refactor] Use concise C++11 code in CRPCConvertTable constructor
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/client.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index 042005b9a6..d1eb849b7e 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -210,14 +210,9 @@ public: CRPCConvertTable::CRPCConvertTable() { - const unsigned int n_elem = - (sizeof(vRPCConvertParams) / sizeof(vRPCConvertParams[0])); - - for (unsigned int i = 0; i < n_elem; i++) { - members.insert(std::make_pair(vRPCConvertParams[i].methodName, - vRPCConvertParams[i].paramIdx)); - membersByName.insert(std::make_pair(vRPCConvertParams[i].methodName, - vRPCConvertParams[i].paramName)); + for (const auto& cp : vRPCConvertParams) { + members.emplace(cp.methodName, cp.paramIdx); + membersByName.emplace(cp.methodName, cp.paramName); } } |