Give WalletModel::UnlockContext move semantics #16001

pull sipa wants to merge 1 commits into bitcoin:master from sipa:201905_moveunlockcontext changing 2 files +8 −5
  1. sipa commented at 1:09 AM on May 10, 2019: member

    WalletModel::UnlockContext seems to implement "move upon copy" semantics; with C++11 this can be done more safely using move semantics (making attempts to actually copy fail instead).

    Not a big deal if this isn't worth review time.

  2. Give WalletModel::UnlockContext move semantics 0b09a57aec
  3. fanquake added the label GUI on May 10, 2019
  4. fanquake added the label Wallet on May 10, 2019
  5. DrahtBot commented at 3:30 AM on May 10, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #15529 (Add Qt programs to msvc build by sipsorcery)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. in src/qt/walletmodel.cpp:488 in 0b09a57aec
     481 | @@ -482,7 +482,7 @@ WalletModel::UnlockContext::~UnlockContext()
     482 |      }
     483 |  }
     484 |  
     485 | -void WalletModel::UnlockContext::CopyFrom(const UnlockContext& rhs)
     486 | +void WalletModel::UnlockContext::CopyFrom(UnlockContext&& rhs)
     487 |  {
     488 |      // Transfer context; old object no longer relocks wallet
     489 |      *this = rhs;
    


    promag commented at 1:48 PM on May 15, 2019:

    Is this calling UnlockContext& operator=(UnlockContext&& rhs)?


    sipa commented at 3:53 PM on May 15, 2019:

    No, this calls the (private) default copy constructor.


    Empact commented at 7:21 PM on May 15, 2019:

    Because the rvalue arg becomes an lvalue once it's named (at the beginning of the function).

  7. jonasschnelli commented at 10:16 AM on May 18, 2019: contributor

    utACK 0b09a57aec4c56712711585a4314d73d4d9b6877

  8. jb55 commented at 3:14 PM on May 18, 2019: member

    utACK 0b09a57aec4c56712711585a4314d73d4d9b6877

  9. meshcollider merged this on May 19, 2019
  10. meshcollider closed this on May 19, 2019

  11. meshcollider referenced this in commit 7263424458 on May 19, 2019
  12. sidhujag referenced this in commit 1c5c552dfd on May 20, 2019
  13. fanquake locked this on Jun 24, 2019

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-04-19 09:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me