rpc: Use Join helper in rpc/util

This commit is contained in:
MarcoFalke 2019-08-20 16:58:50 -04:00
parent fa8cd6f9c1
commit faebf62714
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -4,11 +4,12 @@
#include <key_io.h> #include <key_io.h>
#include <outputtype.h> #include <outputtype.h>
#include <script/signingprovider.h>
#include <rpc/util.h> #include <rpc/util.h>
#include <script/descriptor.h> #include <script/descriptor.h>
#include <script/signingprovider.h>
#include <tinyformat.h> #include <tinyformat.h>
#include <util/strencodings.h> #include <util/strencodings.h>
#include <util/string.h>
#include <tuple> #include <tuple>
@ -645,11 +646,7 @@ std::string RPCArg::ToString(const bool oneline) const
} }
case Type::OBJ: case Type::OBJ:
case Type::OBJ_USER_KEYS: { case Type::OBJ_USER_KEYS: {
std::string res; const std::string res = Join(m_inner, ",", [&](const RPCArg& i) { return i.ToStringObj(oneline); });
for (size_t i = 0; i < m_inner.size();) {
res += m_inner[i].ToStringObj(oneline);
if (++i < m_inner.size()) res += ",";
}
if (m_type == Type::OBJ) { if (m_type == Type::OBJ) {
return "{" + res + "}"; return "{" + res + "}";
} else { } else {