diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-08-20 16:58:50 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-08-20 16:52:33 -0400 |
commit | faebf6271467048dc8a9a0c526a0f8565023a966 (patch) | |
tree | 4cc63baa1e5ee80952456c105399fbcaac012770 /src/rpc | |
parent | fa8cd6f9c13319baca467864661982a3dfb2320c (diff) |
rpc: Use Join helper in rpc/util
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/util.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 464537a5b0..22d67c34da 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -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> @@ -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 { |