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.
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-
stickies-v commented at 5:11 PM on July 10, 2025: contributor
-
c2bb73708a
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.
-
31bbaab9f1
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.
-
DrahtBot commented at 5:11 PM on July 10, 2025: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32942.
<!--021abf342d371248e50ceaed478a90ca-->
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.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
-
e68a4ba976
rpc: use more util::Join
Use Join where we manually concatenated before, or use ranges to simplify the code.
- stickies-v force-pushed on Jul 10, 2025
- DrahtBot added the label CI failed on Jul 10, 2025
-
DrahtBot commented at 8:20 PM on July 10, 2025: contributor
<!--85328a0da195eb286784d51f73fa0af9-->
🚧 At least one of the CI tasks failed. <sub>Task
tidy: https://github.com/bitcoin/bitcoin/runs/45741536315</sub> <sub>LLM reason (✨ experimental): clang-tidy detected errors related to recursive call chains, causing the CI to fail.</sub><details><summary>Hints</summary>
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.
</details>
-
w0xlt commented at 8:42 PM on July 10, 2025: contributor
- DrahtBot removed the label CI failed on Jul 11, 2025
-
stickies-v commented at 1:31 PM on October 14, 2025: contributor
Closing for lack of reviewer interest, it's not a critical change.
- stickies-v closed this on Oct 14, 2025