Skip to content

Commit

Permalink
rpc: Use Join helper in rpc/util
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Aug 20, 2019
1 parent fa8cd6f commit faebf62
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/rpc/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

#include <key_io.h>
#include <outputtype.h>
#include <script/signingprovider.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <script/signingprovider.h>
#include <tinyformat.h>
#include <util/strencodings.h>
#include <util/string.h>

#include <tuple>

Expand Down Expand Up @@ -645,11 +646,7 @@ std::string RPCArg::ToString(const bool oneline) const
}
case Type::OBJ:
case Type::OBJ_USER_KEYS: {
std::string res;
for (size_t i = 0; i < m_inner.size();) {
res += m_inner[i].ToStringObj(oneline);
if (++i < m_inner.size()) res += ",";
}
const std::string res = Join(m_inner, ",", [&](const RPCArg& i) { return i.ToStringObj(oneline); });
if (m_type == Type::OBJ) {
return "{" + res + "}";
} else {
Expand Down

0 comments on commit faebf62

Please sign in to comment.