diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-08-17 14:39:07 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-08-17 15:55:07 +0200 |
commit | fadf671fa539e76d000a08b92109ea5503d5f3ac (patch) | |
tree | b2454fd7ce9abf0d9896be241ca55c093d1e48c5 /src | |
parent | faeea1ab586e30ca3b980999a264f2a3b4769143 (diff) |
Refactor: Remove confusing static_cast
Diffstat (limited to 'src')
-rw-r--r-- | src/addresstype.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/addresstype.cpp b/src/addresstype.cpp index 0d51b2d4b6..2454cfb5d9 100644 --- a/src/addresstype.cpp +++ b/src/addresstype.cpp @@ -18,27 +18,27 @@ typedef std::vector<unsigned char> valtype; 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 CKeyID& pubkey_id) : BaseHash(pubkey_id) {} 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) { - return CKeyID{static_cast<uint160>(key_hash)}; + return CKeyID{uint160{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) { - return CScriptID{static_cast<uint160>(script_hash)}; + return CScriptID{uint160{script_hash}}; } WitnessV0ScriptHash::WitnessV0ScriptHash(const CScript& in) |