Skip to content

Commit

Permalink
bytes.ReplaceAt bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Jul 13, 2015
1 parent 3a8250f commit 9157596
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bytes.v7/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ func ReplaceAt(b []byte, off, nsrc int, dest []byte) []byte {
}

if ndelta > 0 {
tailoff := len(b) - ndelta
b = append(b, b[tailoff:]...)
b = append(b, dest[:ndelta]...)
copy(b[off+len(dest):], b[off+nsrc:])
copy(b[off:], dest)
} else {
Expand Down

0 comments on commit 9157596

Please sign in to comment.