From 3fe4a7970bbcd42b83b283af367a7a559b34b4c8 Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Wed, 20 Nov 2024 11:53:47 +0100 Subject: [PATCH] [fold] remove unused variable --- src/ripple/app/tx/impl/Transactor.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/ripple/app/tx/impl/Transactor.cpp b/src/ripple/app/tx/impl/Transactor.cpp index f8d302170..b19f9b391 100644 --- a/src/ripple/app/tx/impl/Transactor.cpp +++ b/src/ripple/app/tx/impl/Transactor.cpp @@ -1081,27 +1081,20 @@ Transactor::checkMultiSign(PreclaimContext const& ctx) // increment the touch counter on an account static void -touchAccount( - ApplyView& view, - AccountID const& id, - std::optional> sle) +touchAccount(ApplyView& view, AccountID const& id) { if (!view.rules().enabled(featureTouch)) return; + std::shared_ptr sle = view.peek(keylet::account(id)); if (!sle) - sle = view.peek(keylet::account(id)); - - if (!sle || !(*sle)) return; - uint64_t tc = (*sle)->isFieldPresent(sfTouchCount) - ? (*sle)->getFieldU64(sfTouchCount) - : 0; + uint64_t tc = + sle->isFieldPresent(sfTouchCount) ? sle->getFieldU64(sfTouchCount) : 0; - (*sle)->setFieldU64(sfTouchCount, tc + 1); - - view.update(*sle); + sle->setFieldU64(sfTouchCount, tc + 1); + view.update(sle); } static void @@ -1536,7 +1529,7 @@ Transactor::doTSH( if ((!canRollback && strong) || (canRollback && !strong)) continue; - touchAccount(view, tshAccountID, {}); + touchAccount(view, tshAccountID); auto klTshHook = keylet::hook(tshAccountID);