Skip to content

Commit

Permalink
[FOLD] Disambiguate execution order
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatcam committed Dec 20, 2023
1 parent 70e61ba commit dc2c2a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ripple/rpc/handlers/GetAggregatePrice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ doGetAggregatePrice(RPC::JsonContext& context)
{
static STAmount two{noIssue(), 2, 0};
auto it = itAdvance(prices.right.begin(), middle - 1);
auto const sum = it->first + (++it)->first;
return divide(sum, two, noIssue());
auto const& a1 = it->first;
auto const& a2 = (++it)->first;
return divide(a1 + a2, two, noIssue());
}
return itAdvance(prices.right.begin(), middle)->first;
}();
Expand Down

0 comments on commit dc2c2a6

Please sign in to comment.