Skip to content

Commit

Permalink
Merge pull request #12 from qiniu/develop
Browse files Browse the repository at this point in the history
bytes.ReplaceAt bugfix
  • Loading branch information
xushiwei committed Jul 13, 2015
2 parents 85a65f6 + 9157596 commit 83501c5
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 83501c5

Please sign in to comment.