[optimization] Prevent unnecessary list creation
Prevent unnecessary list creation
This commit is contained in:
parent
68412ce15f
commit
97548591d6
@ -163,7 +163,7 @@ private MongoDbOffsetContext getPreviousOffset(MongoDbConnectorConfig connectorC
|
||||
Collection<Map<String, String>> partitions = loader.getPartitions();
|
||||
|
||||
Map<Map<String, String>, Map<String, Object>> offsets = context.offsetStorageReader().offsets(partitions);
|
||||
if (offsets != null && !offsets.values().stream().filter(Objects::nonNull).collect(Collectors.toList()).isEmpty()) {
|
||||
if (offsets != null && offsets.values().stream().anyMatch(Objects::nonNull)) {
|
||||
MongoDbOffsetContext offsetContext = loader.loadOffsets(offsets);
|
||||
logger.info("Found previous offsets {}", offsetContext);
|
||||
return offsetContext;
|
||||
|
Loading…
Reference in New Issue
Block a user