Prefer iterators arrow operator over iterator dereference #10907

pull bytting wants to merge 1 commits into bitcoin:master from bytting:20170722-refactor-arrow-1 changing 18 files +82 −82
  1. bytting commented at 10:51 AM on July 22, 2017: contributor

    Prefer iterators arrow operator over iterator dereference to improve readability

  2. dcousens approved
  3. fanquake added the label Refactoring on Jul 22, 2017
  4. practicalswift commented at 7:27 PM on July 22, 2017: contributor

    Should we extend this to doing it globally? If so, the following might be of help:

    git grep -E '\(\*[a-zA-Z0-9]+\)\.(first|second)' # 80 occurrences of 
                                                     # which 7 in validation.cpp
    

    Ideally such a change should probably be made as an scripted-diff.

  5. bytting commented at 1:37 AM on July 23, 2017: contributor

    For the sake of completeness I added a few more (@practicalswift, thanks for the regex)

    I'm not quite comfortable with automating this but if someone wants to go for that, that's fine with me. If automation makes this PR redundant, feel free to close it.

    Also, if this regex is to be automated, we should probably take the possibility of whitespaces between the parentheses into consideration.

  6. Use iterators arrow operator over iterator dereference d9dd96f903
  7. laanwj commented at 2:31 PM on October 9, 2017: member

    Although I agree with you with regard to readability, I'm not convinced this is worth the risk to do as a global change. Sorry, closing.

  8. laanwj closed this on Oct 9, 2017

  9. bytting commented at 9:54 PM on October 9, 2017: contributor

    @laanwj Fair enough. By the way, would you take them incrementally?

  10. 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-22 06:15 UTC

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