mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Replace MakeSpan helper with Span deduction guide
This commit is contained in:
@@ -196,7 +196,7 @@ static void Checksum(Span<const uint8_t> addr_pubkey, uint8_t (&checksum)[CHECKS
|
||||
|
||||
SHA3_256 hasher;
|
||||
|
||||
hasher.Write(MakeSpan(prefix).first(prefix_len));
|
||||
hasher.Write(Span{prefix}.first(prefix_len));
|
||||
hasher.Write(addr_pubkey);
|
||||
hasher.Write(VERSION);
|
||||
|
||||
@@ -693,13 +693,13 @@ uint32_t CNetAddr::GetLinkedIPv4() const
|
||||
return ReadBE32(m_addr.data());
|
||||
} else if (IsRFC6052() || IsRFC6145()) {
|
||||
// mapped IPv4, SIIT translated IPv4: the IPv4 address is the last 4 bytes of the address
|
||||
return ReadBE32(MakeSpan(m_addr).last(ADDR_IPV4_SIZE).data());
|
||||
return ReadBE32(Span{m_addr}.last(ADDR_IPV4_SIZE).data());
|
||||
} else if (IsRFC3964()) {
|
||||
// 6to4 tunneled IPv4: the IPv4 address is in bytes 2-6
|
||||
return ReadBE32(MakeSpan(m_addr).subspan(2, ADDR_IPV4_SIZE).data());
|
||||
return ReadBE32(Span{m_addr}.subspan(2, ADDR_IPV4_SIZE).data());
|
||||
} else if (IsRFC4380()) {
|
||||
// Teredo tunneled IPv4: the IPv4 address is in the last 4 bytes of the address, but bitflipped
|
||||
return ~ReadBE32(MakeSpan(m_addr).last(ADDR_IPV4_SIZE).data());
|
||||
return ~ReadBE32(Span{m_addr}.last(ADDR_IPV4_SIZE).data());
|
||||
}
|
||||
assert(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user