Skip to content

Commit

Permalink
Refactored ImpAdjuster.
Browse files Browse the repository at this point in the history
  • Loading branch information
And1sS committed Jan 24, 2025
1 parent d5d45c3 commit c466359
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/org/prebid/server/auction/ImpAdjuster.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
import com.iab.openrtb.request.Imp;
import org.prebid.server.json.JacksonMapper;
import org.prebid.server.json.JsonMerger;
import org.prebid.server.util.StreamUtil;
import org.prebid.server.validation.ImpValidator;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.StreamSupport;

public class ImpAdjuster {

Expand Down Expand Up @@ -83,9 +82,8 @@ private void setAeParams(ObjectNode ext) {
final boolean extIgsAePresent = Optional.ofNullable(ext)
.map(extNode -> extNode.get(EXT_IGS))
.filter(JsonNode::isArray)
.map(extNode -> StreamSupport.stream(extNode.spliterator(), false).toList())
.stream()
.flatMap(Collection::stream)
.flatMap(extNode -> StreamUtil.asStream(extNode.spliterator()))
.filter(Objects::nonNull)
.anyMatch(igsElementNode -> igsElementNode.has(EXT_AE));

Expand Down

0 comments on commit c466359

Please sign in to comment.