Skip to content

Commit fade0b5

Browse files
author
MarcoFalke
committed
scripted-diff: Use std::span over Span
-BEGIN VERIFY SCRIPT- ren() { sed -i "s!\<$1\>!$2!g" $( git grep -l "$1" -- "./src" ":(exclude)src/span.h" ":(exclude)src/leveldb/db/log_test.cc" ) ; } ren Span std::span ren AsBytes std::as_bytes ren AsWritableBytes std::as_writable_bytes sed -i 's!SpanPopBack(Span!SpanPopBack(std::span!g' ./src/span.h -END VERIFY SCRIPT-
1 parent fadccc2 commit fade0b5

File tree

120 files changed

+543
-543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+543
-543
lines changed

src/base58.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static const int8_t mapBase58[256] = {
8686
return true;
8787
}
8888

89-
std::string EncodeBase58(Span<const unsigned char> input)
89+
std::string EncodeBase58(std::span<const unsigned char> input)
9090
{
9191
// Skip & count leading zeroes.
9292
int zeroes = 0;
@@ -134,7 +134,7 @@ bool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet, in
134134
return DecodeBase58(str.c_str(), vchRet, max_ret_len);
135135
}
136136

137-
std::string EncodeBase58Check(Span<const unsigned char> input)
137+
std::string EncodeBase58Check(std::span<const unsigned char> input)
138138
{
139139
// add 4-byte hash check to the end
140140
std::vector<unsigned char> vch(input.begin(), input.end());
@@ -151,7 +151,7 @@ std::string EncodeBase58Check(Span<const unsigned char> input)
151151
return false;
152152
}
153153
// re-calculate the checksum, ensure it matches the included 4-byte checksum
154-
uint256 hash = Hash(Span{vchRet}.first(vchRet.size() - 4));
154+
uint256 hash = Hash(std::span{vchRet}.first(vchRet.size() - 4));
155155
if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {
156156
vchRet.clear();
157157
return false;

src/base58.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/**
2323
* Encode a byte span as a base58-encoded string
2424
*/
25-
std::string EncodeBase58(Span<const unsigned char> input);
25+
std::string EncodeBase58(std::span<const unsigned char> input);
2626

2727
/**
2828
* Decode a base58-encoded string (str) into a byte vector (vchRet).
@@ -33,7 +33,7 @@ std::string EncodeBase58(Span<const unsigned char> input);
3333
/**
3434
* Encode a byte span into a base58-encoded string, including checksum
3535
*/
36-
std::string EncodeBase58Check(Span<const unsigned char> input);
36+
std::string EncodeBase58Check(std::span<const unsigned char> input);
3737

3838
/**
3939
* Decode a base58-encoded string (str) that includes a checksum into a byte

src/bench/load_external.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void LoadExternalBlockFile(benchmark::Bench& bench)
4646
ss << static_cast<uint32_t>(benchmark::data::block413567.size());
4747
// We can't use the streaming serialization (ss << benchmark::data::block413567)
4848
// because that first writes a compact size.
49-
ss << Span{benchmark::data::block413567};
49+
ss << std::span{benchmark::data::block413567};
5050

5151
// Create the test file.
5252
{

src/bip324.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void BIP324Cipher::Initialize(const EllSwiftPubKey& their_pubkey, bool initiator
7070
m_key = CKey();
7171
}
7272

73-
void BIP324Cipher::Encrypt(Span<const std::byte> contents, Span<const std::byte> aad, bool ignore, Span<std::byte> output) noexcept
73+
void BIP324Cipher::Encrypt(std::span<const std::byte> contents, std::span<const std::byte> aad, bool ignore, std::span<std::byte> output) noexcept
7474
{
7575
assert(output.size() == contents.size() + EXPANSION);
7676

@@ -86,7 +86,7 @@ void BIP324Cipher::Encrypt(Span<const std::byte> contents, Span<const std::byte>
8686
m_send_p_cipher->Encrypt(header, contents, aad, output.subspan(LENGTH_LEN));
8787
}
8888

89-
uint32_t BIP324Cipher::DecryptLength(Span<const std::byte> input) noexcept
89+
uint32_t BIP324Cipher::DecryptLength(std::span<const std::byte> input) noexcept
9090
{
9191
assert(input.size() == LENGTH_LEN);
9292

@@ -97,7 +97,7 @@ uint32_t BIP324Cipher::DecryptLength(Span<const std::byte> input) noexcept
9797
return uint32_t(buf[0]) + (uint32_t(buf[1]) << 8) + (uint32_t(buf[2]) << 16);
9898
}
9999

100-
bool BIP324Cipher::Decrypt(Span<const std::byte> input, Span<const std::byte> aad, bool& ignore, Span<std::byte> contents) noexcept
100+
bool BIP324Cipher::Decrypt(std::span<const std::byte> input, std::span<const std::byte> aad, bool& ignore, std::span<std::byte> contents) noexcept
101101
{
102102
assert(input.size() + LENGTH_LEN == contents.size() + EXPANSION);
103103

src/bip324.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,29 +68,29 @@ class BIP324Cipher
6868
*
6969
* It must hold that output.size() == contents.size() + EXPANSION.
7070
*/
71-
void Encrypt(Span<const std::byte> contents, Span<const std::byte> aad, bool ignore, Span<std::byte> output) noexcept;
71+
void Encrypt(std::span<const std::byte> contents, std::span<const std::byte> aad, bool ignore, std::span<std::byte> output) noexcept;
7272

7373
/** Decrypt the length of a packet. Only after Initialize().
7474
*
7575
* It must hold that input.size() == LENGTH_LEN.
7676
*/
77-
unsigned DecryptLength(Span<const std::byte> input) noexcept;
77+
unsigned DecryptLength(std::span<const std::byte> input) noexcept;
7878

7979
/** Decrypt a packet. Only after Initialize().
8080
*
8181
* It must hold that input.size() + LENGTH_LEN == contents.size() + EXPANSION.
8282
* Contents.size() must equal the length returned by DecryptLength.
8383
*/
84-
bool Decrypt(Span<const std::byte> input, Span<const std::byte> aad, bool& ignore, Span<std::byte> contents) noexcept;
84+
bool Decrypt(std::span<const std::byte> input, std::span<const std::byte> aad, bool& ignore, std::span<std::byte> contents) noexcept;
8585

8686
/** Get the Session ID. Only after Initialize(). */
87-
Span<const std::byte> GetSessionID() const noexcept { return m_session_id; }
87+
std::span<const std::byte> GetSessionID() const noexcept { return m_session_id; }
8888

8989
/** Get the Garbage Terminator to send. Only after Initialize(). */
90-
Span<const std::byte> GetSendGarbageTerminator() const noexcept { return m_send_garbage_terminator; }
90+
std::span<const std::byte> GetSendGarbageTerminator() const noexcept { return m_send_garbage_terminator; }
9191

9292
/** Get the expected Garbage Terminator to receive. Only after Initialize(). */
93-
Span<const std::byte> GetReceiveGarbageTerminator() const noexcept { return m_recv_garbage_terminator; }
93+
std::span<const std::byte> GetReceiveGarbageTerminator() const noexcept { return m_recv_garbage_terminator; }
9494
};
9595

9696
#endif // BITCOIN_BIP324_H

src/cluster_linearize.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class DepGraph
7575
*
7676
* @param depgraph The original DepGraph that is being remapped.
7777
*
78-
* @param mapping A Span such that mapping[i] gives the position in the new DepGraph
78+
* @param mapping A std::span such that mapping[i] gives the position in the new DepGraph
7979
* for position i in the old depgraph. Its size must be equal to
8080
* depgraph.PositionRange(). The value of mapping[i] is ignored if
8181
* position i is a hole in depgraph (i.e., if !depgraph.Positions()[i]).
@@ -86,7 +86,7 @@ class DepGraph
8686
*
8787
* Complexity: O(N^2) where N=depgraph.TxCount().
8888
*/
89-
DepGraph(const DepGraph<SetType>& depgraph, Span<const ClusterIndex> mapping, ClusterIndex pos_range) noexcept : entries(pos_range)
89+
DepGraph(const DepGraph<SetType>& depgraph, std::span<const ClusterIndex> mapping, ClusterIndex pos_range) noexcept : entries(pos_range)
9090
{
9191
Assume(mapping.size() == depgraph.PositionRange());
9292
Assume((pos_range == 0) == (depgraph.TxCount() == 0));
@@ -371,7 +371,7 @@ struct SetInfo
371371

372372
/** Compute the feerates of the chunks of linearization. */
373373
template<typename SetType>
374-
std::vector<FeeFrac> ChunkLinearization(const DepGraph<SetType>& depgraph, Span<const ClusterIndex> linearization) noexcept
374+
std::vector<FeeFrac> ChunkLinearization(const DepGraph<SetType>& depgraph, std::span<const ClusterIndex> linearization) noexcept
375375
{
376376
std::vector<FeeFrac> ret;
377377
for (ClusterIndex i : linearization) {
@@ -396,7 +396,7 @@ class LinearizationChunking
396396
const DepGraph<SetType>& m_depgraph;
397397

398398
/** The linearization we started from, possibly with removed prefix stripped. */
399-
Span<const ClusterIndex> m_linearization;
399+
std::span<const ClusterIndex> m_linearization;
400400

401401
/** Chunk sets and their feerates, of what remains of the linearization. */
402402
std::vector<SetInfo<SetType>> m_chunks;
@@ -437,7 +437,7 @@ class LinearizationChunking
437437

438438
public:
439439
/** Initialize a LinearizationSubset object for a given length of linearization. */
440-
explicit LinearizationChunking(const DepGraph<SetType>& depgraph LIFETIMEBOUND, Span<const ClusterIndex> lin LIFETIMEBOUND) noexcept :
440+
explicit LinearizationChunking(const DepGraph<SetType>& depgraph LIFETIMEBOUND, std::span<const ClusterIndex> lin LIFETIMEBOUND) noexcept :
441441
m_depgraph(depgraph), m_linearization(lin)
442442
{
443443
// Mark everything in lin as todo still.
@@ -1016,7 +1016,7 @@ class SearchCandidateFinder
10161016
* Complexity: possibly O(N * min(max_iterations + N, sqrt(2^N))) where N=depgraph.TxCount().
10171017
*/
10181018
template<typename SetType>
1019-
std::pair<std::vector<ClusterIndex>, bool> Linearize(const DepGraph<SetType>& depgraph, uint64_t max_iterations, uint64_t rng_seed, Span<const ClusterIndex> old_linearization = {}) noexcept
1019+
std::pair<std::vector<ClusterIndex>, bool> Linearize(const DepGraph<SetType>& depgraph, uint64_t max_iterations, uint64_t rng_seed, std::span<const ClusterIndex> old_linearization = {}) noexcept
10201020
{
10211021
Assume(old_linearization.empty() || old_linearization.size() == depgraph.TxCount());
10221022
if (depgraph.TxCount() == 0) return {{}, true};
@@ -1110,7 +1110,7 @@ std::pair<std::vector<ClusterIndex>, bool> Linearize(const DepGraph<SetType>& de
11101110
* postlinearize" process.
11111111
*/
11121112
template<typename SetType>
1113-
void PostLinearize(const DepGraph<SetType>& depgraph, Span<ClusterIndex> linearization)
1113+
void PostLinearize(const DepGraph<SetType>& depgraph, std::span<ClusterIndex> linearization)
11141114
{
11151115
// This algorithm performs a number of passes (currently 2); the even ones operate from back to
11161116
// front, the odd ones from front to back. Each results in an equal-or-better linearization
@@ -1299,7 +1299,7 @@ void PostLinearize(const DepGraph<SetType>& depgraph, Span<ClusterIndex> lineari
12991299
* Complexity: O(N^2) where N=depgraph.TxCount(); O(N) if both inputs are identical.
13001300
*/
13011301
template<typename SetType>
1302-
std::vector<ClusterIndex> MergeLinearizations(const DepGraph<SetType>& depgraph, Span<const ClusterIndex> lin1, Span<const ClusterIndex> lin2)
1302+
std::vector<ClusterIndex> MergeLinearizations(const DepGraph<SetType>& depgraph, std::span<const ClusterIndex> lin1, std::span<const ClusterIndex> lin2)
13031303
{
13041304
Assume(lin1.size() == depgraph.TxCount());
13051305
Assume(lin2.size() == depgraph.TxCount());

src/common/bloom.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ CBloomFilter::CBloomFilter(const unsigned int nElements, const double nFPRate, c
4040
{
4141
}
4242

43-
inline unsigned int CBloomFilter::Hash(unsigned int nHashNum, Span<const unsigned char> vDataToHash) const
43+
inline unsigned int CBloomFilter::Hash(unsigned int nHashNum, std::span<const unsigned char> vDataToHash) const
4444
{
4545
// 0xFBA4C795 chosen as it guarantees a reasonable bit difference between nHashNum values.
4646
return MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash) % (vData.size() * 8);
4747
}
4848

49-
void CBloomFilter::insert(Span<const unsigned char> vKey)
49+
void CBloomFilter::insert(std::span<const unsigned char> vKey)
5050
{
5151
if (vData.empty()) // Avoid divide-by-zero (CVE-2013-5700)
5252
return;
@@ -65,7 +65,7 @@ void CBloomFilter::insert(const COutPoint& outpoint)
6565
insert(MakeUCharSpan(stream));
6666
}
6767

68-
bool CBloomFilter::contains(Span<const unsigned char> vKey) const
68+
bool CBloomFilter::contains(std::span<const unsigned char> vKey) const
6969
{
7070
if (vData.empty()) // Avoid divide-by-zero (CVE-2013-5700)
7171
return true;
@@ -187,12 +187,12 @@ CRollingBloomFilter::CRollingBloomFilter(const unsigned int nElements, const dou
187187
}
188188

189189
/* Similar to CBloomFilter::Hash */
190-
static inline uint32_t RollingBloomHash(unsigned int nHashNum, uint32_t nTweak, Span<const unsigned char> vDataToHash)
190+
static inline uint32_t RollingBloomHash(unsigned int nHashNum, uint32_t nTweak, std::span<const unsigned char> vDataToHash)
191191
{
192192
return MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash);
193193
}
194194

195-
void CRollingBloomFilter::insert(Span<const unsigned char> vKey)
195+
void CRollingBloomFilter::insert(std::span<const unsigned char> vKey)
196196
{
197197
if (nEntriesThisGeneration == nEntriesPerGeneration) {
198198
nEntriesThisGeneration = 0;
@@ -223,7 +223,7 @@ void CRollingBloomFilter::insert(Span<const unsigned char> vKey)
223223
}
224224
}
225225

226-
bool CRollingBloomFilter::contains(Span<const unsigned char> vKey) const
226+
bool CRollingBloomFilter::contains(std::span<const unsigned char> vKey) const
227227
{
228228
for (int n = 0; n < nHashFuncs; n++) {
229229
uint32_t h = RollingBloomHash(n, nTweak, vKey);

src/common/bloom.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CBloomFilter
4949
unsigned int nTweak;
5050
unsigned char nFlags;
5151

52-
unsigned int Hash(unsigned int nHashNum, Span<const unsigned char> vDataToHash) const;
52+
unsigned int Hash(unsigned int nHashNum, std::span<const unsigned char> vDataToHash) const;
5353

5454
public:
5555
/**
@@ -66,10 +66,10 @@ class CBloomFilter
6666

6767
SERIALIZE_METHODS(CBloomFilter, obj) { READWRITE(obj.vData, obj.nHashFuncs, obj.nTweak, obj.nFlags); }
6868

69-
void insert(Span<const unsigned char> vKey);
69+
void insert(std::span<const unsigned char> vKey);
7070
void insert(const COutPoint& outpoint);
7171

72-
bool contains(Span<const unsigned char> vKey) const;
72+
bool contains(std::span<const unsigned char> vKey) const;
7373
bool contains(const COutPoint& outpoint) const;
7474

7575
//! True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS
@@ -110,8 +110,8 @@ class CRollingBloomFilter
110110
public:
111111
CRollingBloomFilter(const unsigned int nElements, const double nFPRate);
112112

113-
void insert(Span<const unsigned char> vKey);
114-
bool contains(Span<const unsigned char> vKey) const;
113+
void insert(std::span<const unsigned char> vKey);
114+
bool contains(std::span<const unsigned char> vKey) const;
115115

116116
void reset();
117117

src/common/pcp.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ std::string PCPResultString(uint8_t result_code)
179179
}
180180

181181
//! Wrap address in IPv6 according to RFC6887. wrapped_addr needs to be able to store 16 bytes.
182-
[[nodiscard]] bool PCPWrapAddress(Span<uint8_t> wrapped_addr, const CNetAddr &addr)
182+
[[nodiscard]] bool PCPWrapAddress(std::span<uint8_t> wrapped_addr, const CNetAddr &addr)
183183
{
184184
Assume(wrapped_addr.size() == ADDR_IPV6_SIZE);
185185
if (addr.IsIPv4()) {
@@ -200,7 +200,7 @@ std::string PCPResultString(uint8_t result_code)
200200
}
201201

202202
//! Unwrap PCP-encoded address according to RFC6887.
203-
CNetAddr PCPUnwrapAddress(Span<const uint8_t> wrapped_addr)
203+
CNetAddr PCPUnwrapAddress(std::span<const uint8_t> wrapped_addr)
204204
{
205205
Assume(wrapped_addr.size() == ADDR_IPV6_SIZE);
206206
if (util::HasPrefix(wrapped_addr, IPV4_IN_IPV6_PREFIX)) {
@@ -215,9 +215,9 @@ CNetAddr PCPUnwrapAddress(Span<const uint8_t> wrapped_addr)
215215
}
216216

217217
//! PCP or NAT-PMP send-receive loop.
218-
std::optional<std::vector<uint8_t>> PCPSendRecv(Sock &sock, const std::string &protocol, Span<const uint8_t> request, int num_tries,
218+
std::optional<std::vector<uint8_t>> PCPSendRecv(Sock &sock, const std::string &protocol, std::span<const uint8_t> request, int num_tries,
219219
std::chrono::milliseconds timeout_per_try,
220-
std::function<bool(Span<const uint8_t>)> check_packet)
220+
std::function<bool(std::span<const uint8_t>)> check_packet)
221221
{
222222
using namespace std::chrono;
223223
// UDP is a potentially lossy protocol, so we try to send again a few times.
@@ -254,9 +254,9 @@ std::optional<std::vector<uint8_t>> PCPSendRecv(Sock &sock, const std::string &p
254254
LogPrintLevel(BCLog::NET, BCLog::Level::Warning, "%s: Could not receive response: %s\n", protocol, NetworkErrorString(WSAGetLastError()));
255255
return std::nullopt; // Network-level error, probably no use retrying.
256256
}
257-
LogPrintLevel(BCLog::NET, BCLog::Level::Debug, "%s: Received response of %d bytes: %s\n", protocol, recvsz, HexStr(Span(response, recvsz)));
257+
LogPrintLevel(BCLog::NET, BCLog::Level::Debug, "%s: Received response of %d bytes: %s\n", protocol, recvsz, HexStr(std::span(response, recvsz)));
258258

259-
if (check_packet(Span<uint8_t>(response, recvsz))) {
259+
if (check_packet(std::span<uint8_t>(response, recvsz))) {
260260
got_response = true; // Got expected response, break from receive loop as well as from retry loop.
261261
break;
262262
}
@@ -309,7 +309,7 @@ std::variant<MappingResult, MappingError> NATPMPRequestPortMap(const CNetAddr &g
309309
request[NATPMP_HDR_OP_OFS] = NATPMP_REQUEST | NATPMP_OP_GETEXTERNAL;
310310

311311
auto recv_res = PCPSendRecv(*sock, "natpmp", request, num_tries, timeout_per_try,
312-
[&](const Span<const uint8_t> response) -> bool {
312+
[&](const std::span<const uint8_t> response) -> bool {
313313
if (response.size() < NATPMP_GETEXTERNAL_RESPONSE_SIZE) {
314314
LogPrintLevel(BCLog::NET, BCLog::Level::Warning, "natpmp: Response too small\n");
315315
return false; // Wasn't response to what we expected, try receiving next packet.
@@ -346,7 +346,7 @@ std::variant<MappingResult, MappingError> NATPMPRequestPortMap(const CNetAddr &g
346346
WriteBE32(request.data() + NATPMP_MAP_REQUEST_LIFETIME_OFS, lifetime);
347347

348348
recv_res = PCPSendRecv(*sock, "natpmp", request, num_tries, timeout_per_try,
349-
[&](const Span<const uint8_t> response) -> bool {
349+
[&](const std::span<const uint8_t> response) -> bool {
350350
if (response.size() < NATPMP_MAP_RESPONSE_SIZE) {
351351
LogPrintLevel(BCLog::NET, BCLog::Level::Warning, "natpmp: Response too small\n");
352352
return false; // Wasn't response to what we expected, try receiving next packet.
@@ -438,7 +438,7 @@ std::variant<MappingResult, MappingError> PCPRequestPortMap(const PCPMappingNonc
438438
request[ofs + PCP_HDR_VERSION_OFS] = PCP_VERSION;
439439
request[ofs + PCP_HDR_OP_OFS] = PCP_REQUEST | PCP_OP_MAP;
440440
WriteBE32(request.data() + ofs + PCP_HDR_LIFETIME_OFS, lifetime);
441-
if (!PCPWrapAddress(Span(request).subspan(ofs + PCP_REQUEST_HDR_IP_OFS, ADDR_IPV6_SIZE), internal)) return MappingError::NETWORK_ERROR;
441+
if (!PCPWrapAddress(std::span(request).subspan(ofs + PCP_REQUEST_HDR_IP_OFS, ADDR_IPV6_SIZE), internal)) return MappingError::NETWORK_ERROR;
442442

443443
ofs += PCP_HDR_SIZE;
444444

@@ -449,15 +449,15 @@ std::variant<MappingResult, MappingError> PCPRequestPortMap(const PCPMappingNonc
449449
request[ofs + PCP_MAP_PROTOCOL_OFS] = PCP_PROTOCOL_TCP;
450450
WriteBE16(request.data() + ofs + PCP_MAP_INTERNAL_PORT_OFS, port);
451451
WriteBE16(request.data() + ofs + PCP_MAP_EXTERNAL_PORT_OFS, port);
452-
if (!PCPWrapAddress(Span(request).subspan(ofs + PCP_MAP_EXTERNAL_IP_OFS, ADDR_IPV6_SIZE), bind)) return MappingError::NETWORK_ERROR;
452+
if (!PCPWrapAddress(std::span(request).subspan(ofs + PCP_MAP_EXTERNAL_IP_OFS, ADDR_IPV6_SIZE), bind)) return MappingError::NETWORK_ERROR;
453453

454454
ofs += PCP_MAP_SIZE;
455455
Assume(ofs == request.size());
456456

457457
// Receive loop.
458458
bool is_natpmp = false;
459459
auto recv_res = PCPSendRecv(*sock, "pcp", request, num_tries, timeout_per_try,
460-
[&](const Span<const uint8_t> response) -> bool {
460+
[&](const std::span<const uint8_t> response) -> bool {
461461
// Unsupported version according to RFC6887 appendix A and RFC6886 section 3.5, can fall back to NAT-PMP.
462462
if (response.size() == NATPMP_RESPONSE_HDR_SIZE && response[PCP_HDR_VERSION_OFS] == NATPMP_VERSION && response[PCP_RESPONSE_HDR_RESULT_OFS] == NATPMP_RESULT_UNSUPP_VERSION) {
463463
is_natpmp = true;

src/compressor.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ struct ScriptCompression
6565
void Ser(Stream &s, const CScript& script) {
6666
CompressedScript compr;
6767
if (CompressScript(script, compr)) {
68-
s << Span{compr};
68+
s << std::span{compr};
6969
return;
7070
}
7171
unsigned int nSize = script.size() + nSpecialScripts;
7272
s << VARINT(nSize);
73-
s << Span{script};
73+
s << std::span{script};
7474
}
7575

7676
template<typename Stream>
@@ -79,7 +79,7 @@ struct ScriptCompression
7979
s >> VARINT(nSize);
8080
if (nSize < nSpecialScripts) {
8181
CompressedScript vch(GetSpecialScriptSize(nSize), 0x00);
82-
s >> Span{vch};
82+
s >> std::span{vch};
8383
DecompressScript(script, nSize, vch);
8484
return;
8585
}
@@ -90,7 +90,7 @@ struct ScriptCompression
9090
s.ignore(nSize);
9191
} else {
9292
script.resize(nSize);
93-
s >> Span{script};
93+
s >> std::span{script};
9494
}
9595
}
9696
};

0 commit comments

Comments
 (0)