Use stream
This commit is contained in:
parent
bb064cbbbd
commit
c081f9b8d3
@ -133,6 +133,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Data
|
||||
@ -430,14 +431,10 @@ public final class EdgeGrpcSession implements Closeable {
|
||||
}
|
||||
|
||||
private List<DownlinkMsg> convertToDownlinkMsgsPack(List<EdgeEvent> edgeEvents) {
|
||||
List<DownlinkMsg> result = new ArrayList<>();
|
||||
for (EdgeEvent edgeEvent : edgeEvents) {
|
||||
DownlinkMsg downlinkMsg = convertToDownlinkMsg(edgeEvent);
|
||||
if (downlinkMsg != null) {
|
||||
result.add(downlinkMsg);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return edgeEvents
|
||||
.stream()
|
||||
.map(this::convertToDownlinkMsg)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private DownlinkMsg processEntityMergeRequestMessage(EdgeEvent edgeEvent) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user