refactor: simplify GetAncestor #31778

pull kcalvinalvin wants to merge 1 commits into bitcoin:master from kcalvinalvin:2025-02-02-simplify-getancestor changing 2 files +77 −10
  1. kcalvinalvin commented at 6:19 am on February 2, 2025: contributor

    The if statement in GetAncestor was quite hard to make sense of. Simplifying it improves readability and the added test ensures that the performance remains the same.

    I’m not quite sure if the test makes sense to have but including it as it’s the code used to make sure no loss in performance was made. Tested locally up to height 1«29.

  2. DrahtBot commented at 6:19 am on February 2, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31778.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  3. DrahtBot added the label Refactoring on Feb 2, 2025
  4. refactor: simplify GetAncestor
    The if statement in GetAncestor was quite hard to make sense of.
    Simplifying it improves readability and the added test ensures that the
    performance remains the same.
    5983f166c9
  5. kcalvinalvin force-pushed on Feb 2, 2025

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: 2025-02-22 21:13 UTC

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