[qt] Optimizes boolean expression model && model->haveWatchOnly() #12074

pull l2a5b1 wants to merge 1 commits into bitcoin:master from l2a5b1:patch/TransactionView-optimize-boolean-expression changing 1 files +1 −1
  1. l2a5b1 commented at 12:44 AM on January 2, 2018: contributor

    This PR optimizes the boolean expression model && model->haveWatchOnly() to model->haveWatchOnly().

    The boolean expression can be optimized because the method TransactionView::exportClicked already guards against a potential dereferenced null pointer by returning early if model is null. https://github.com/bitcoin/bitcoin/blob/63a4dc10876bfc61c2e87d35dcf17da2f0f8c316/src/qt/transactionview.cpp#L351-L353

  2. [qt] Simplifies boolean expression model && model->haveWatchOnly()
    The boolean expression model && model->haveWatchOnly() can be simplified to model->haveWatchOnly(), because if (!model || !model->getOptionsModel()) { return; } guards against a potential dereferenced null pointer.
    6dda059bde
  3. dcousens approved
  4. unknown approved
  5. fanquake added the label GUI on Jan 2, 2018
  6. promag commented at 2:15 AM on January 2, 2018: member

    ACK 6dda059.

  7. fanquake deleted a comment on Jan 2, 2018
  8. MarcoFalke added the label Refactoring on Jan 2, 2018
  9. jonasschnelli commented at 7:57 AM on January 4, 2018: contributor

    utACK 6dda059bde0798f54626108beab29d9d3834769c

  10. jonasschnelli merged this on Jan 4, 2018
  11. jonasschnelli closed this on Jan 4, 2018

  12. jonasschnelli referenced this in commit a1136f0cb4 on Jan 4, 2018
  13. l2a5b1 deleted the branch on Jan 4, 2018
  14. PastaPastaPasta referenced this in commit 1414729d19 on Jan 17, 2020
  15. PastaPastaPasta referenced this in commit 15efe46dec on Jan 22, 2020
  16. PastaPastaPasta referenced this in commit 0e2634f948 on Jan 22, 2020
  17. PastaPastaPasta referenced this in commit 20edadace3 on Jan 29, 2020
  18. PastaPastaPasta referenced this in commit c841555df3 on Jan 29, 2020
  19. PastaPastaPasta referenced this in commit c3a1f928ea on Jan 29, 2020
  20. PastaPastaPasta referenced this in commit 291051f209 on Jan 31, 2020
  21. ckti referenced this in commit fcf7027e9b on Mar 28, 2021
  22. DrahtBot 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-04-21 18:15 UTC

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