Refactor: Changes postincrement to preincrement in for loop in src/consensus files #14749

pull vim88 wants to merge 1 commits into bitcoin:master from vim88:postincrement_to_preincrement_src_consensus changing 2 files +5 −5
  1. vim88 commented at 8:20 PM on November 17, 2018: contributor

    Changed the postincrement operator to a preincrement operator in the for loops in src/consensus/merkle.cpp and src/consensus/tx_verify.cpp.

    The compiler might actually optimize the for loop process in either case, but like the Developer Notes say: ++i is preferred over i++.

  2. Refactor: Changes postincrement to preincrement in for loop in src/consensus files a1fb77ec0e
  3. sipa commented at 8:25 PM on November 17, 2018: member

    NACK.

    While preincrement in general is preferable over postincrement, there is no practical different when we're talking about integer types. Every compiler created the past 10 years will produce identical code for both. Changes to consensus code need more justification than this.

  4. vim88 commented at 8:51 PM on November 17, 2018: contributor

    Thank you for the quick input!

  5. vim88 closed this on Nov 17, 2018

  6. fanquake locked this on Nov 18, 2018
Contributors

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