From fa41c657022b8f99c8e6718a0e33c5838c412a0b Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sat, 30 May 2020 10:11:02 -0400 Subject: [PATCH] rpc: Simplify GetAllOutputTypes with the Join helper This commit does not change behavior --- src/rpc/rawtransaction.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 814f8bddfe..a05ed86954 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -511,12 +511,11 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request) static std::string GetAllOutputTypes() { - std::string ret; + std::vector ret; for (int i = TX_NONSTANDARD; i <= TX_WITNESS_UNKNOWN; ++i) { - if (i != TX_NONSTANDARD) ret += ", "; - ret += GetTxnOutputType(static_cast(i)); + ret.emplace_back(GetTxnOutputType(static_cast(i))); } - return ret; + return Join(ret, ", "); } static UniValue decodescript(const JSONRPCRequest& request)