Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
vsolovei committed Sep 29, 2022
1 parent cd50bc0 commit 7bb422e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/bidderinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,17 @@ func processBidderInfos(reader InfoReader, normalizeBidderName func(string) (ope
infos := BidderInfos{}

for fileName, data := range bidderConfigs {
info := BidderInfo{}
if err := yaml.Unmarshal(data, &info); err != nil {
return nil, fmt.Errorf("error parsing config for bidder %s: %v", fileName, err)
}

bidderName := strings.Split(fileName, ".")
if len(bidderName) == 2 && bidderName[1] == "yaml" {
normalizedBidderName, bidderNameExists := normalizeBidderName(bidderName[0])
if !bidderNameExists {
return nil, fmt.Errorf("error parsing config for bidder %s: unknown bidder", fileName)
}
info := BidderInfo{}
if err := yaml.Unmarshal(data, &info); err != nil {
return nil, fmt.Errorf("error parsing config for bidder %s: %v", fileName, err)
}

infos[string(normalizedBidderName)] = info
}
}
Expand Down

0 comments on commit 7bb422e

Please sign in to comment.