refactor, bench, fuzz: Drop unneeded UCharCast calls #29820

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:240406-uchar changing 3 files +3 −3
  1. hebasto commented at 2:50 pm on April 6, 2024: member

    The CKey::Set() template function handles std::byte just fine: https://github.com/bitcoin/bitcoin/blob/b5d21182e5a66110ce2796c2c99da39c8ebf0d72/src/key.h#L105

    Noticed in #29774 (review).

  2. refactor, bench, fuzz: Drop unneeded `UCharCast` calls
    The `CKey::Set()` template function handles `std::byte` just fine.
    56e1e5dd10
  3. DrahtBot commented at 2:50 pm on April 6, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, laanwj, hernanmarino

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

    Conflicts

    No conflicts as of last run.

  4. maflcko commented at 9:04 am on April 7, 2024: member

    lgtm ACK 56e1e5dd10cbe51d3abc3fbf532b6b41bf62a889

    A (more invasive) alternative would be to use Set(Span<std::byte>), or Set(Span<BasicByte>)

  5. laanwj commented at 3:58 pm on April 9, 2024: member
    Seems fine, code review ACK 56e1e5dd10cbe51d3abc3fbf532b6b41bf62a889
  6. hernanmarino commented at 7:56 pm on April 9, 2024: contributor
    ACK 56e1e5dd10cbe51d3abc3fbf532b6b41bf62a889
  7. fanquake merged this on Apr 9, 2024
  8. fanquake closed this on Apr 9, 2024

  9. hebasto deleted the branch on Apr 10, 2024
  10. maflcko commented at 10:34 am on April 10, 2024: member

    Just for reference, the reason this is safe, is not because of the line linked to in the pull request description, but due to the existing UCharCast in the function. Error when trying to pass the wrong type:

    0./key.h:103:26: error: no matching function for call to 'UCharCast'
    1  103 |         } else if (Check(UCharCast(&pbegin[0]))) {
    2      |                          ^~~~~~~~~
    3note: in instantiation of function template specialization 'CKey::Set<__gnu_cxx::__normal_iterator<int *, std::vector<int>>>' requested here
    

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-24 18:12 UTC

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