Skip to content

Commit da0478e

Browse files
committed
Merge #10961: Improve readability of DecodeBase58Check(...)
c6a995e Improve readability of DecodeBase58Check(...) (practicalswift) Pull request description: Use the more readable form ... ```c++ &vchRet[vchRet.size() - 4] ``` ... instead of ... ```c++ &v.end()[-n] ``` Has the added benefit of eliminating a spurious static analyzer warning about improper use of negative values. Tree-SHA512: 5895310c189e9322082c28f34342ff9a6c238e2cae3f204521111c8a7981bc555af60b42de082c91608c1125dfc244a65c4faf929249a067a51435e2be74cb39
2 parents d473e6d + c6a995e commit da0478e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/base58.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)
139139
}
140140
// re-calculate the checksum, ensure it matches the included 4-byte checksum
141141
uint256 hash = Hash(vchRet.begin(), vchRet.end() - 4);
142-
if (memcmp(&hash, &vchRet.end()[-4], 4) != 0) {
142+
if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {
143143
vchRet.clear();
144144
return false;
145145
}

0 commit comments

Comments
 (0)