refactor: spanify DecodeBits, use constexpr std::array instead of vector #31302

pull PastaPastaPasta wants to merge 1 commits into bitcoin:master from PastaPastaPasta:refactor-spanify-DecodeBits changing 1 files +5 −5
  1. PastaPastaPasta commented at 6:43 am on November 17, 2024: contributor

    Should generally prefer using std::span over const std::vector&, and generally should use constexpr std::array instead of the const std::vector as used here. This allows the interface to be more flexible (thought the value is low here) and allows it to be more constexpr.

    Brief investigation was made into spanifing other interfaces in this file; however, the usage of the specialization std::vector made that incompatible with trivial spanification

  2. refactor: spanify DecodeBits, use constexpr std::array instead of vector
    Brief investigation was made into spanifing other interfaces in this file; however, the usage of the specialization std::vector<bool> made that incompatible with trivial spanification
    7d728dcc87
  3. DrahtBot commented at 6:43 am on November 17, 2024: 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/31302.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept NACK l0rinc

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Refactoring on Nov 17, 2024
  5. DrahtBot added the label CI failed on Nov 17, 2024
  6. DrahtBot commented at 7:06 am on November 17, 2024: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/33095335126

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  7. pinheadmz commented at 11:05 am on November 17, 2024: member
    I think we try to avoid unnecessary refactors for “general preference”. If there’s no performance improvement with these changes it’s likely to get ignored by reviewers.
  8. l0rinc commented at 11:34 am on November 17, 2024: contributor
    approach NACK, we should only modify this when the affected area is already changed and tested well enough (+ whole build is red, also indicating this wasn’t the case). The risk of breaking something is a lot greater while the benefit is likely very small. These should usually be bundled with other related changes, having a concrete purpose (e.g. tests are covering something that cannot happen in reality, new feature being introduced, result is undeniably safer code, etc).
  9. fanquake closed this on Nov 19, 2024


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: 2024-11-21 06:12 UTC

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