*: replace slice.Copy with bytes.Clone

And refactor some code a bit, don't use bytes.Clone where type-specific
helpers may be used instead.

Close #2907.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2024-03-04 21:09:36 +03:00
parent b030c331b0
commit 8162e9033d
26 changed files with 68 additions and 89 deletions

View file

@ -22,13 +22,6 @@ func reverse(dst []byte, src []byte) {
}
}
// Copy copies the byte slice into new slice (make/copy).
func Copy(b []byte) []byte {
d := make([]byte, len(b))
copy(d, b)
return d
}
// Clean wipes the data in b by filling it with zeros.
func Clean(b []byte) {
for i := range b {