Skip to content

Commit

Permalink
fix: remove redundant moves (XRPLF#4565)
Browse files Browse the repository at this point in the history
- Resolve gcc compiler warning:
      AccountObjects.cpp:182:47: warning: redundant move in initialization [-Wredundant-move]
  - The std::move() operation on trivially copyable types may generate a
    compile warning in newer versions of gcc.
- Remove extraneous header (unused imports) from a unit test file.
  • Loading branch information
ckeshava committed Sep 25, 2023
1 parent a5f9ccf commit 3f7c5b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/ripple/rpc/handlers/AccountObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <ripple/app/main/Application.h>
#include <ripple/app/tx/impl/details/NFTokenUtils.h>
#include <ripple/json/json_writer.h>
#include <ripple/ledger/ReadView.h>
#include <ripple/net/RPCErr.h>
#include <ripple/protocol/ErrorCodes.h>
Expand Down Expand Up @@ -66,7 +65,7 @@ doAccountNFTs(RPC::JsonContext& context)
RPC::inject_error(rpcACT_MALFORMED, result);
return result;
}
auto const accountID{std::move(id.value())};
auto const accountID{id.value()};

if (!ledger->exists(keylet::account(accountID)))
return rpcError(rpcACT_NOT_FOUND);
Expand Down Expand Up @@ -179,7 +178,7 @@ doAccountObjects(RPC::JsonContext& context)
RPC::inject_error(rpcACT_MALFORMED, result);
return result;
}
auto const accountID{std::move(id.value())};
auto const accountID{id.value()};

if (!ledger->exists(keylet::account(accountID)))
return rpcError(rpcACT_NOT_FOUND);
Expand Down
1 change: 0 additions & 1 deletion src/test/rpc/ReportingETL_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
//==============================================================================

#include <ripple/app/ledger/LedgerMaster.h>
#include <ripple/app/reporting/P2pProxy.h>
#include <ripple/beast/unit_test.h>
#include <ripple/rpc/impl/Tuning.h>
Expand Down

0 comments on commit 3f7c5b8

Please sign in to comment.