Skip to content

Commit fa41c65

Browse files
author
MarcoFalke
committed
rpc: Simplify GetAllOutputTypes with the Join helper
This commit does not change behavior
1 parent 02b26ba commit fa41c65

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,12 +511,11 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
511511

512512
static std::string GetAllOutputTypes()
513513
{
514-
std::string ret;
514+
std::vector<std::string> ret;
515515
for (int i = TX_NONSTANDARD; i <= TX_WITNESS_UNKNOWN; ++i) {
516-
if (i != TX_NONSTANDARD) ret += ", ";
517-
ret += GetTxnOutputType(static_cast<txnouttype>(i));
516+
ret.emplace_back(GetTxnOutputType(static_cast<txnouttype>(i)));
518517
}
519-
return ret;
518+
return Join(ret, ", ");
520519
}
521520

522521
static UniValue decodescript(const JSONRPCRequest& request)

0 commit comments

Comments
 (0)