diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2017-05-25 04:28:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-25 04:28:22 +0800 |
commit | 261b3e235160d30cc7176e02fd0a43f2b60409c6 (patch) | |
tree | 9d3eb6eec9fc2d30badba7bc6824560bcb317132 /common/bytes.go | |
parent | 344f25fb3ec26818c673a5b68b21b527759d7499 (diff) | |
parent | 11cf5b7eadb7fcfa56a0cb98ec4ebbddce00f4c0 (diff) | |
download | dexon-261b3e235160d30cc7176e02fd0a43f2b60409c6.tar.gz dexon-261b3e235160d30cc7176e02fd0a43f2b60409c6.tar.zst dexon-261b3e235160d30cc7176e02fd0a43f2b60409c6.zip |
Merge pull request #14336 from obscuren/metropolis-preparation
consensus, core/*, params: metropolis preparation refactor
Diffstat (limited to 'common/bytes.go')
-rw-r--r-- | common/bytes.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/bytes.go b/common/bytes.go index 0342083a1..c445968f2 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -89,18 +89,18 @@ func Hex2BytesFixed(str string, flen int) []byte { } func RightPadBytes(slice []byte, l int) []byte { - if l < len(slice) { + if l <= len(slice) { return slice } padded := make([]byte, l) - copy(padded[0:len(slice)], slice) + copy(padded, slice) return padded } func LeftPadBytes(slice []byte, l int) []byte { - if l < len(slice) { + if l <= len(slice) { return slice } |