Skip to content

Commit fadf671

Browse files
author
MarcoFalke
committed
Refactor: Remove confusing static_cast
1 parent faeea1a commit fadf671

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/addresstype.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@
1818
typedef std::vector<unsigned char> valtype;
1919

2020
ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
21-
ScriptHash::ScriptHash(const CScriptID& in) : BaseHash(static_cast<uint160>(in)) {}
21+
ScriptHash::ScriptHash(const CScriptID& in) : BaseHash{in} {}
2222

2323
PKHash::PKHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
2424
PKHash::PKHash(const CKeyID& pubkey_id) : BaseHash(pubkey_id) {}
2525

2626
WitnessV0KeyHash::WitnessV0KeyHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
27-
WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash(static_cast<uint160>(pubkey_hash)) {}
27+
WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash{pubkey_hash} {}
2828

2929
CKeyID ToKeyID(const PKHash& key_hash)
3030
{
31-
return CKeyID{static_cast<uint160>(key_hash)};
31+
return CKeyID{uint160{key_hash}};
3232
}
3333

3434
CKeyID ToKeyID(const WitnessV0KeyHash& key_hash)
3535
{
36-
return CKeyID{static_cast<uint160>(key_hash)};
36+
return CKeyID{uint160{key_hash}};
3737
}
3838

3939
CScriptID ToScriptID(const ScriptHash& script_hash)
4040
{
41-
return CScriptID{static_cast<uint160>(script_hash)};
41+
return CScriptID{uint160{script_hash}};
4242
}
4343

4444
WitnessV0ScriptHash::WitnessV0ScriptHash(const CScript& in)

0 commit comments

Comments
 (0)