@@ -714,7 +714,7 @@ private List<BidderResponseInfo> injectWithTargetingAndBidRanking(
714714 .toList ())));
715715
716716 final Set <BidInfo > winningBids = new HashSet <>();
717- final Map <String , List <BidInfo >> seatToBids = new HashMap <>();
717+ final Map <String , Map < String , List <BidInfo >>> seatToBidderToBids = new HashMap <>();
718718
719719 for (final List <BidInfo > bidInfos : impIdToBidInfos .values ()) {
720720 final List <BidInfo > bidsWithRanking = isBidRankingEnabled
@@ -726,15 +726,17 @@ private List<BidderResponseInfo> injectWithTargetingAndBidRanking(
726726 if (!bidsWithRanking .isEmpty ()) {
727727 winningBids .add (bidsWithRanking .getFirst ());
728728 bidsWithRanking .forEach (bidInfo ->
729- seatToBids .computeIfAbsent (bidInfo .getSeat (), k -> new ArrayList <>()).add (bidInfo ));
729+ seatToBidderToBids .computeIfAbsent (bidInfo .getSeat (), k -> new HashMap <>())
730+ .computeIfAbsent (bidInfo .getBidder (), k -> new ArrayList <>()).add (bidInfo ));
730731 }
731732 }
732733
733734 return bidderResponseToReducedBidInfos .keySet ().stream ()
734735 .map (bidderResponseInfo -> injectBidInfoWithTargeting (
735736 bidderResponseInfo ,
736737 bidderToMultiBids ,
737- seatToBids .getOrDefault (bidderResponseInfo .getSeat (), Collections .emptyList ()),
738+ seatToBidderToBids .getOrDefault (bidderResponseInfo .getSeat (), Collections .emptyMap ())
739+ .getOrDefault (bidderResponseInfo .getBidder (), Collections .emptyList ()),
738740 winningBids ))
739741 .toList ();
740742 }
0 commit comments