[script] Avoid implicit casts from bool to CScriptNum #11110

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:implicit-casts-from-bool-to-cscriptnum changing 1 files +11 −11
  1. practicalswift commented at 6:52 PM on August 22, 2017: contributor

    Avoid implicit casts from bool to CScriptNum.

    Rationale: Explicit is better than implicit.

  2. script: Avoid implicit casts from bool to CScriptNum 350f5b3053
  3. promag commented at 3:34 AM on August 23, 2017: member

    There is no implicit cast here, instead it uses CScriptNum& operator=( const int64_t& rhs).

    For that reason NACK as is.

  4. practicalswift commented at 7:18 AM on August 23, 2017: contributor

    @promag The conversion from bool is clearly implicit, isn't it?

  5. promag commented at 10:06 AM on August 23, 2017: member

    @practicalswift right, sorry, late night I thought you meant implicit construction.

  6. laanwj added the label Refactoring on Aug 23, 2017
  7. practicalswift renamed this:
    script: Avoid implicit casts from bool to CScriptNum
    [script] Avoid implicit casts from bool to CScriptNum
    on Aug 23, 2017
  8. ryanofsky commented at 8:45 PM on November 2, 2017: member

    utACK 350f5b30533eebaf27d9a63c3d8d0bea3df3a291

    Seems like a fine change, does what is described, don't really think it's good or bad.

  9. laanwj commented at 9:06 AM on November 20, 2017: member

    I really don't like doing unnecessary changes in consensus code. The implicit case from bool to int64 is fully defined behavior.

    IMO, this also, doesn't make the code easier to understand, just longer.

    Sorry, going to close this. If there is overwhelming agreement to do this we should reopen, but otherwise, meh.

  10. laanwj closed this on Nov 20, 2017

  11. practicalswift commented at 10:08 AM on November 20, 2017: contributor

    OK :-)

  12. practicalswift deleted the branch on Apr 10, 2021
  13. DrahtBot locked this on Aug 18, 2022

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-16 15:15 UTC

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