Sorry for not creating a pull request but this line: https://github.com/bitcoin/bitcoin/blob/master/src/base58.cpp#L96 should read:
str.assign(zeroes, pszBase58[0]);
Sorry for not creating a pull request but this line: https://github.com/bitcoin/bitcoin/blob/master/src/base58.cpp#L96 should read:
str.assign(zeroes, pszBase58[0]);
Looks fine to me...
Looks fine, but it is more efficient.
Funny though because I spotted this and sent a pull request for fixing it about 30 minutes before finding this :P
Please close this and continue the discussion in the PR #6323.
I don't understand how a vector lookup (which requires at least dereferencing a pointer and reading from memory) can be faster than using a constant.
I agree with Wladimir though; not for or against, but pointless.
In this case, the vector is const. It could be interesting to compare the actual output of compilers in both cases... But this is something completely different. This issue is really pointless.
If someone were to change the alphabet, the function would no longer produce the correct result. For Bitcoin's purposes, its unlikely that the string would ever change. I did say this was minor.
@vinniefalco To be extremely blunt: Bitcoin Core does not exist to make Ripple (or anything non-Bitcoin) produce the correct results.