[#168] client: Adopt replacement of pointer slices with struct slices

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2022-03-11 12:16:08 +03:00 committed by Alex Vanin
parent e89a0d88d2
commit 9c5d3d9dfa
7 changed files with 21 additions and 28 deletions

View file

@ -71,14 +71,11 @@ func (x *prmCommonMeta) WithXHeaders(hs ...string) {
func (x prmCommonMeta) writeToMetaHeader(h *v2session.RequestMetaHeader) {
if len(x.xHeaders) > 0 {
hs := make([]*v2session.XHeader, 0, len(x.xHeaders)/2)
hs := make([]v2session.XHeader, len(x.xHeaders)/2)
for i := 0; i < len(x.xHeaders); i += 2 {
var h v2session.XHeader
h.SetKey(x.xHeaders[i])
h.SetValue(x.xHeaders[i+1])
hs = append(hs, &h)
hs[i].SetKey(x.xHeaders[i])
hs[i].SetValue(x.xHeaders[i+1])
}
h.SetXHeaders(hs)