Skip to content

Commit

Permalink
MetaX: adjusts impression looping
Browse files Browse the repository at this point in the history
Signed-off-by: Kehan Pan <[email protected]>
  • Loading branch information
metax-kehan committed Jul 29, 2024
1 parent f250cf1 commit 895c22e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions adapters/metax/metax.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.E

// split impressions
reqDatas := make([]*adapters.RequestData, 0, len(request.Imp))
for i := range request.Imp {
imp := &request.Imp[i]
impCopy := *imp
requestCopy := *request

metaxExt, err := parseBidderExt(imp)
for _, imp := range request.Imp {
metaxExt, err := parseBidderExt(&imp)
if err != nil {
errs = append(errs, err)
continue
}

if err := preprocessImp(&impCopy); err != nil {
if err := preprocessImp(&imp); err != nil {
errs = append(errs, err)
continue
}
Expand All @@ -50,7 +46,8 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.E
continue
}

requestCopy.Imp = []openrtb2.Imp{impCopy}
requestCopy := *request
requestCopy.Imp = []openrtb2.Imp{imp}
reqJSON, err := json.Marshal(requestCopy)
if err != nil {
errs = append(errs, err)
Expand Down

0 comments on commit 895c22e

Please sign in to comment.