encoding.base58: fix notice for slice creation (#21935)

This commit is contained in:
Roman 2024-07-26 14:28:17 +07:00 committed by GitHub
parent 7baff15c39
commit 52fe7c09b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,7 +87,7 @@ pub fn encode_walpha_bytes(input []u8, alphabet Alphabet) []u8 {
for i = zcount; i < sz && out[i] == 0; i++ {}
// now encode the values with actual alphabet in-place
val := out[i - zcount..]
val := unsafe { out[i - zcount..] }
sz = val.len
for i = 0; i < sz; i++ {
out[i] = alphabet.encode[val[i]]