optimize slice allocation in GetAllBenefactor

This commit is contained in:
Amir Tavakolian 2026-05-03 15:14:50 +03:30
parent b9db2926c1
commit 9c8f005a50
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ func (s Service) GetAllBenefactor(ctx context.Context, req param.BenefactorGetAl
return param.BenefactorGetAllResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected) return param.BenefactorGetAllResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
} }
resp := make([]param.Data, 0) resp := make([]param.Data, len(benefactors))
for _, benefactor := range benefactors { for _, benefactor := range benefactors {
resp = append(resp, param.Data{ resp = append(resp, param.Data{
ID: benefactor.ID, ID: benefactor.ID,