Use std::move when deleting CTransactions from CTxMempool #8099

issue sipa opened this issue on May 25, 2016
  1. sipa commented at 3:31 PM on May 25, 2016: member

    Currently, many CTxMempool::remove*() functions copy the transaction they delete to a std::list, and then erase the mempool entries. This copy + erase can be avoided by using c++11's std::move.

    Practically, this would mean passing a std::list<CTransaction>& to all remove* functions, down to removeUnchecked, which would move the CTransactions being deleted to that list before calling the erase method on maptx.

  2. sipa cross-referenced this on May 26, 2016 from issue Compact Blocks by TheBlueMatt
  3. rodentrabies cross-referenced this on Jul 7, 2016 from issue Use std::move() instead of copying/removing in TxMemPool by rodentrabies
  4. fanquake commented at 8:33 AM on November 7, 2016: member

    Think this can be closed after #8515 ?

  5. sipa closed this on Nov 7, 2016

  6. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC