rest/rpc: use more util::Join #32942

pull stickies-v wants to merge 3 commits into bitcoin:master from stickies-v:2025-07/more-join changing 3 files +37 −52
  1. stickies-v commented at 5:11 pm on July 10, 2025: contributor
    There are a few places in the RPC and REST code where we manually join multiple items into a string. This PR removes a bunch of that logic and replaces it with util::Join. To minimize unnecessary container allocations and simplify implementations, the first commit slightly refactors util::Join so it can subsequently be used with range adaptors.
  2. util: make Join compatible with ranges
    By using a forwarding reference for `container`, the function can
    be used with range adaptors that produce views that are not iterable
    when const.
    c2bb73708a
  3. rest: make rf_names a map to simplify code
    As a map, we can use views and util::Join on it to avoid duplicating
    logic.
    31bbaab9f1
  4. DrahtBot commented at 5:11 pm on July 10, 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/32942.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK w0xlt

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

  5. rpc: use more util::Join
    Use Join where we manually concatenated before, or use ranges to
    simplify the code.
    e68a4ba976
  6. stickies-v force-pushed on Jul 10, 2025
  7. DrahtBot added the label CI failed on Jul 10, 2025
  8. DrahtBot commented at 8:20 pm on July 10, 2025: contributor

    🚧 At least one of the CI tasks failed. Task tidy: https://github.com/bitcoin/bitcoin/runs/45741536315 LLM reason (✨ experimental): clang-tidy detected errors related to recursive call chains, causing the CI to fail.

    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.

  9. w0xlt commented at 8:42 pm on July 10, 2025: contributor
  10. DrahtBot removed the label CI failed on Jul 11, 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-07-11 09:13 UTC

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