Refactor: Remove confusing static_cast

This commit is contained in:
MarcoFalke 2023-08-17 14:39:07 +02:00
parent faeea1ab58
commit fadf671fa5
No known key found for this signature in database

View File

@ -18,27 +18,27 @@
typedef std::vector<unsigned char> valtype; typedef std::vector<unsigned char> valtype;
ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {} ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
ScriptHash::ScriptHash(const CScriptID& in) : BaseHash(static_cast<uint160>(in)) {} ScriptHash::ScriptHash(const CScriptID& in) : BaseHash{in} {}
PKHash::PKHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {} PKHash::PKHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
PKHash::PKHash(const CKeyID& pubkey_id) : BaseHash(pubkey_id) {} PKHash::PKHash(const CKeyID& pubkey_id) : BaseHash(pubkey_id) {}
WitnessV0KeyHash::WitnessV0KeyHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {} WitnessV0KeyHash::WitnessV0KeyHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash(static_cast<uint160>(pubkey_hash)) {} WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash{pubkey_hash} {}
CKeyID ToKeyID(const PKHash& key_hash) CKeyID ToKeyID(const PKHash& key_hash)
{ {
return CKeyID{static_cast<uint160>(key_hash)}; return CKeyID{uint160{key_hash}};
} }
CKeyID ToKeyID(const WitnessV0KeyHash& key_hash) CKeyID ToKeyID(const WitnessV0KeyHash& key_hash)
{ {
return CKeyID{static_cast<uint160>(key_hash)}; return CKeyID{uint160{key_hash}};
} }
CScriptID ToScriptID(const ScriptHash& script_hash) CScriptID ToScriptID(const ScriptHash& script_hash)
{ {
return CScriptID{static_cast<uint160>(script_hash)}; return CScriptID{uint160{script_hash}};
} }
WitnessV0ScriptHash::WitnessV0ScriptHash(const CScript& in) WitnessV0ScriptHash::WitnessV0ScriptHash(const CScript& in)