Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove confusing static_cast in address types #28284

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Aug 17, 2023

It seems confusing to use static_cast<uint160>(bla) to call the constructor of uint160. The normal and common way to call a constructor is by simply calling it. (uint160{bla}).

Do this, and also drop the constructor completely where the existing const& reference is enough.

Also, add missing includes while touching the file.

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 17, 2023

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK vincenzopalazzo, TheCharlatan

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

@TheCharlatan
Copy link
Contributor

Concept ACK

Copy link

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fadf671

Copy link
Contributor

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fadf671

@fanquake fanquake merged commit 03a536f into bitcoin:master Aug 22, 2023
15 checks passed
@maflcko maflcko deleted the 2308-no-static_cast- branch August 22, 2023 13:52
Frank-GER pushed a commit to syscoin/syscoin that referenced this pull request Sep 8, 2023
…s types

fadf671 Refactor: Remove confusing static_cast (MarcoFalke)
faeea1a refactor: Add missing includes (MarcoFalke)

Pull request description:

  It seems confusing to use `static_cast<uint160>(bla)` to call the constructor of `uint160`. The normal and common way to call a constructor is by simply calling it. (`uint160{bla}`).

  Do this, and also drop the constructor completely where the existing `const&` reference is enough.

  Also, add missing includes while touching the file.

ACKs for top commit:
  vincenzopalazzo:
    ACK bitcoin@fadf671
  TheCharlatan:
    ACK fadf671

Tree-SHA512: 8fb9a72203a6461b1f4b38bb90943ca25a92b218fc87da2022b90802e7747350e3668a13db3189201ad30e2e39a51d6658fed4aad176fd52cecc1c7f972c3134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants