Skip to content

Commit

Permalink
Add if constexpr for version dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Jan 10, 2024
1 parent c05401b commit 49bd9ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ripple/app/misc/NetworkOPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3169,11 +3169,12 @@ NetworkOPsImp::transJson(
MultiApiJson multiObj{jvObj};
forAllApiVersions(
multiObj.visit(), //
[&](Json::Value& jvTx, auto apiVersion) {
[&]<unsigned Version>(
Json::Value& jvTx, std::integral_constant<unsigned, Version>) {
RPC::insertDeliverMax(
jvTx[jss::transaction], transaction->getTxnType(), apiVersion);
jvTx[jss::transaction], transaction->getTxnType(), Version);

if (apiVersion > 1)
if constexpr (Version > 1)
{
jvTx[jss::tx_json] = jvTx.removeMember(jss::transaction);
jvTx[jss::hash] = hash;
Expand Down

0 comments on commit 49bd9ae

Please sign in to comment.