refactor: Remove args-wrappers in favor of naked value_or() #36295

pull hodlinator wants to merge 1 commits into bitcoin:master from hodlinator:2026/09/args_value_or changing 3 files +15 −37
  1. hodlinator commented at 12:22 PM on September 18, 2026: contributor

    Decreases complexity at the foundation at the only cost of a change to ArgsManager::GetPathArg_() and slightly more verbose code in one leaf; src/qt/optionsmodel.cpp.

    Also represents slight decrease in complexity of pending PR #31260 which has an extra GetPtr() function for disambiguating between overloaded functions.

    Original thread: #31260 (review)

    (Rebased it onto the current base commit of #31260 and rebased #31260 on top of that, removed GetPtr(), and confirmed it still compiles: https://github.com/hodlinator/bitcoin/tree/pr/31260_no_GetPtr).

  2. args: Remove wrapper-functions in favor of naked optional::value_or()
    Decreases complexity at the foundation at the only cost of a change to ArgsManager::GetPathArg_() and slightly more verbose code in one leaf; src/qt/optionsmodel.cpp.
    
    Also represents slight decrease in complexity of pending PR #31260 which has an extra GetPtr() function for disambiguating between overloaded functions.
    60e95b412c
  3. DrahtBot added the label Refactoring on Sep 18, 2026
  4. DrahtBot commented at 12:23 PM on September 18, 2026: 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/36295.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK l0rinc
    Concept ACK stickies-v

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #17783 (common: Disallow calling IsArgSet() on ALLOW_LIST options by ryanofsky)
    • #17581 (refactor: Remove settings merge reverse precedence code by ryanofsky)
    • #17580 (refactor: Add ALLOW_LIST flags and enforce usage in CheckArgFlags by ryanofsky)
    • #17493 (util: Forbid ambiguous multiple assignments in config file by ryanofsky)
    • #16545 (refactor: Implement missing error checking for ArgsManager flags by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. l0rinc commented at 5:38 PM on September 18, 2026: contributor

    lightly tested code review ACK 60e95b412c999aa9efe561c99994f8e53d5ab4f6

    Pure refactor, the removed helpers were thin wrappers that just delegated to the existing std::optional-returning overloads via value_or() - inlining them simplifies the interface.

  6. stickies-v commented at 11:02 AM on September 22, 2026: contributor

    Concept ACK


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-09-25 15:50 UTC

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