From ab729f1ae9e4ad608d5176ceb7820b259d3a1772 Mon Sep 17 00:00:00 2001 From: Gregory Tsipenyuk Date: Sat, 14 Oct 2023 20:21:39 -0400 Subject: [PATCH] Simplify type deduction --- src/ripple/app/tx/impl/OfferStream.cpp | 33 ++++---------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/src/ripple/app/tx/impl/OfferStream.cpp b/src/ripple/app/tx/impl/OfferStream.cpp index 6fea7b332f4..9d90478c242 100644 --- a/src/ripple/app/tx/impl/OfferStream.cpp +++ b/src/ripple/app/tx/impl/OfferStream.cpp @@ -329,42 +329,17 @@ TOfferStreamBase::step() !std::is_same_v && !std::is_same_v) return shouldRmSmallIncreasedQOffer(); - else if constexpr ( - std::is_same_v && - !std::is_same_v) - { - std::visit( - [&](TInAmt&&) { - ret = shouldRmSmallIncreasedQOffer< - std::decay_t, - TOut>(); - }, - toTypedAmt(offer_.amount().in)); - return ret; - } - else if constexpr ( - !std::is_same_v && - std::is_same_v) - { - std::visit( - [&](TOutAmt&&) { - ret = shouldRmSmallIncreasedQOffer< - TIn, - std::decay_t>(); - }, - toTypedAmt(offer_.amount().out)); - return ret; - } else if constexpr ( std::is_same_v && std::is_same_v) { std::visit( [&]( TInAmt&&, TOutAmt&&) { - if constexpr(!std::is_same_v || + if constexpr ( + !std::is_same_v || !std::is_same_v) - ret = shouldRmSmallIncreasedQOffer< - TInAmt, TOutAmt>(); + ret = + shouldRmSmallIncreasedQOffer(); }, toTypedAmt(offer_.amount().in), toTypedAmt(offer_.amount().out));