Skip to content

Commit

Permalink
chore: use copy instead of a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Jul 10, 2023
1 parent 67a538e commit 7c82f60
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions zstd/seqdec.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ func (s *sequenceDecs) execute(seqs []seqVals, hist []byte) error {
dst = dst[:len(src)]
t += len(src)
// Destination is the space we just added.
for i := range src {
dst[i] = src[i]
}
copy(dst, src)
}
}
}
Expand Down Expand Up @@ -395,9 +393,7 @@ func (s *sequenceDecs) decodeSync(hist []byte) error {
// Destination is the space we just added.
dst := out[len(out)-ml:]
dst = dst[:len(src)]
for i := range src {
dst[i] = src[i]
}
copy(dst, src)
}
}
if i == 0 {
Expand Down

0 comments on commit 7c82f60

Please sign in to comment.