Skip to content

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

@maflcko maflcko requested a review from Empact August 18, 2023 10:15
@fanquake fanquake requested a review from achow101 August 18, 2023 11:40
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
@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
@bitcoin bitcoin locked and limited conversation to collaborators Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants