Skip to content

Commit 83501c5

Browse files
committed
Merge pull request #12 from qiniu/develop
bytes.ReplaceAt bugfix
2 parents 85a65f6 + 9157596 commit 83501c5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bytes.v7/replace.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ func ReplaceAt(b []byte, off, nsrc int, dest []byte) []byte {
1717
}
1818

1919
if ndelta > 0 {
20-
tailoff := len(b) - ndelta
21-
b = append(b, b[tailoff:]...)
20+
b = append(b, dest[:ndelta]...)
2221
copy(b[off+len(dest):], b[off+nsrc:])
2322
copy(b[off:], dest)
2423
} else {

0 commit comments

Comments
 (0)